add WithHttpInfo method

This commit is contained in:
wing328
2015-12-03 16:34:51 +08:00
parent a5a4f8c7e0
commit 506b8d2b77
10 changed files with 763 additions and 299 deletions

View File

@@ -25,6 +25,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void UpdatePet (Pet body = null);
/// <summary>
/// Update an existing pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> UpdatePetWithHttpInfo (Pet body = null);
/// <summary>
/// Update an existing pet
/// </summary>
@@ -45,6 +55,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void AddPet (Pet body = null);
/// <summary>
/// Add a new pet to the store
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> AddPetWithHttpInfo (Pet body = null);
/// <summary>
/// Add a new pet to the store
/// </summary>
@@ -65,6 +85,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
List<Pet> FindPetsByStatus (List<string> status = null);
/// <summary>
/// Finds Pets by status
/// </summary>
/// <remarks>
/// Multiple status values can be provided with comma seperated strings
/// </remarks>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns>ApiResponse< List<Pet> ></returns>
ApiResponse<List<Pet>> FindPetsByStatusWithHttpInfo (List<string> status = null);
/// <summary>
/// Finds Pets by status
/// </summary>
@@ -85,6 +115,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
List<Pet> FindPetsByTags (List<string> tags = null);
/// <summary>
/// Finds Pets by tags
/// </summary>
/// <remarks>
/// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </remarks>
/// <param name="tags">Tags to filter by</param>
/// <returns>ApiResponse< List<Pet> ></returns>
ApiResponse<List<Pet>> FindPetsByTagsWithHttpInfo (List<string> tags = null);
/// <summary>
/// Finds Pets by tags
/// </summary>
@@ -105,6 +145,16 @@ namespace IO.Swagger.Api
/// <returns>Pet</returns>
Pet GetPetById (long? petId);
/// <summary>
/// Find pet by ID
/// </summary>
/// <remarks>
/// Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </remarks>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <returns>ApiResponse< Pet ></returns>
ApiResponse<Pet> GetPetByIdWithHttpInfo (long? petId);
/// <summary>
/// Find pet by ID
/// </summary>
@@ -127,6 +177,18 @@ namespace IO.Swagger.Api
/// <returns></returns>
void UpdatePetWithForm (string petId, string name = null, string status = null);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@@ -150,6 +212,17 @@ namespace IO.Swagger.Api
/// <returns></returns>
void DeletePet (long? petId, string apiKey = null);
/// <summary>
/// Deletes a pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"></param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> DeletePetWithHttpInfo (long? petId, string apiKey = null);
/// <summary>
/// Deletes a pet
/// </summary>
@@ -173,6 +246,18 @@ namespace IO.Swagger.Api
/// <returns></returns>
void UploadFile (long? petId, string additionalMetadata = null, Stream file = null);
/// <summary>
/// uploads an image
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="petId">ID of pet to update</param>
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null);
/// <summary>
/// uploads an image
/// </summary>
@@ -230,16 +315,6 @@ namespace IO.Swagger.Api
/// <value>An instance of the Configuration</value>
public Configuration Configuration {get; set;}
/// <summary>
/// Gets the status code of the previous request
/// </summary>
public int StatusCode { get; private set; }
/// <summary>
/// Gets the response headers of the previous request
/// </summary>
public Dictionary<String, String> ResponseHeaders { get; private set; }
private readonly Dictionary<String, String> _defaultHeaderMap = new Dictionary<String, String>();
/// <summary>
@@ -266,8 +341,18 @@ namespace IO.Swagger.Api
/// Update an existing pet
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
/// <returns></returns>
public void UpdatePet (Pet body = null)
{
UpdatePetWithHttpInfo(body);
}
/// <summary>
/// Update an existing pet
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public ApiResponse<Object> UpdatePetWithHttpInfo (Pet body = null)
{
@@ -311,15 +396,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdatePet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -371,11 +458,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdatePet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdatePet: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -385,8 +473,18 @@ namespace IO.Swagger.Api
/// Add a new pet to the store
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
/// <returns></returns>
public void AddPet (Pet body = null)
{
AddPetWithHttpInfo(body);
}
/// <summary>
/// Add a new pet to the store
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public ApiResponse<Object> AddPetWithHttpInfo (Pet body = null)
{
@@ -430,15 +528,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling AddPet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling AddPet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -490,11 +590,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling AddPet: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling AddPet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -504,8 +605,19 @@ namespace IO.Swagger.Api
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns></returns>
/// <returns></returns>
public List<Pet> FindPetsByStatus (List<string> status = null)
{
ApiResponse<List<Pet>> response = FindPetsByStatusWithHttpInfo(status);
return response.Data;
}
/// <summary>
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns></returns>
public ApiResponse< List<Pet> > FindPetsByStatusWithHttpInfo (List<string> status = null)
{
@@ -549,15 +661,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage);
return (List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>));
return new ApiResponse<List<Pet>>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>)));
}
/// <summary>
@@ -609,11 +723,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage);
return (List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>));
}
@@ -622,8 +737,19 @@ namespace IO.Swagger.Api
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns></returns>
/// <returns></returns>
public List<Pet> FindPetsByTags (List<string> tags = null)
{
ApiResponse<List<Pet>> response = FindPetsByTagsWithHttpInfo(tags);
return response.Data;
}
/// <summary>
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns></returns>
public ApiResponse< List<Pet> > FindPetsByTagsWithHttpInfo (List<string> tags = null)
{
@@ -667,15 +793,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage);
return (List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>));
return new ApiResponse<List<Pet>>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>)));
}
/// <summary>
@@ -727,11 +855,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage);
return (List<Pet>) Configuration.ApiClient.Deserialize(response, typeof(List<Pet>));
}
@@ -740,8 +869,19 @@ namespace IO.Swagger.Api
/// Find pet by ID Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </summary>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <returns>Pet</returns>
/// <returns>Pet</returns>
public Pet GetPetById (long? petId)
{
ApiResponse<Pet> response = GetPetByIdWithHttpInfo(petId);
return response.Data;
}
/// <summary>
/// Find pet by ID Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
/// </summary>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <returns>Pet</returns>
public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId)
{
// verify the required parameter 'petId' is set
@@ -788,15 +928,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetPetById: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage);
return (Pet) Configuration.ApiClient.Deserialize(response, typeof(Pet));
return new ApiResponse<Pet>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Pet) Configuration.ApiClient.Deserialize(response, typeof(Pet)));
}
/// <summary>
@@ -850,11 +992,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetPetById: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage);
return (Pet) Configuration.ApiClient.Deserialize(response, typeof(Pet));
}
@@ -865,8 +1008,20 @@ namespace IO.Swagger.Api
/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <returns></returns>
/// <returns></returns>
public void UpdatePetWithForm (string petId, string name = null, string status = null)
{
UpdatePetWithFormWithHttpInfo(petId, name, status);
}
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <returns></returns>
public ApiResponse<Object> UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null)
{
// verify the required parameter 'petId' is set
@@ -915,15 +1070,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -981,11 +1138,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -996,8 +1154,19 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"></param>
/// <returns></returns>
/// <returns></returns>
public void DeletePet (long? petId, string apiKey = null)
{
DeletePetWithHttpInfo(petId, apiKey);
}
/// <summary>
/// Deletes a pet
/// </summary>
/// <param name="petId">Pet id to delete</param>
/// <param name="apiKey"></param>
/// <returns></returns>
public ApiResponse<Object> DeletePetWithHttpInfo (long? petId, string apiKey = null)
{
// verify the required parameter 'petId' is set
@@ -1045,15 +1214,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeletePet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -1109,11 +1280,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeletePet: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeletePet: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -1125,8 +1297,20 @@ namespace IO.Swagger.Api
/// <param name="petId">ID of pet to update</param>
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
/// <returns></returns>
/// <returns></returns>
public void UploadFile (long? petId, string additionalMetadata = null, Stream file = null)
{
UploadFileWithHttpInfo(petId, additionalMetadata, file);
}
/// <summary>
/// uploads an image
/// </summary>
/// <param name="petId">ID of pet to update</param>
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
/// <returns></returns>
public ApiResponse<Object> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null)
{
// verify the required parameter 'petId' is set
@@ -1175,15 +1359,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UploadFile: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -1241,11 +1427,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UploadFile: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UploadFile: " + response.ErrorMessage, response.ErrorMessage);
return;

View File

@@ -24,6 +24,15 @@ namespace IO.Swagger.Api
/// <returns></returns>
Dictionary<string, int?> GetInventory ();
/// <summary>
/// Returns pet inventories by status
/// </summary>
/// <remarks>
/// Returns a map of status codes to quantities
/// </remarks>
/// <returns>ApiResponse< Dictionary<string, int?> ></returns>
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
/// <summary>
/// Returns pet inventories by status
/// </summary>
@@ -43,6 +52,16 @@ namespace IO.Swagger.Api
/// <returns>Order</returns>
Order PlaceOrder (Order body = null);
/// <summary>
/// Place an order for a pet
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse< Order ></returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body = null);
/// <summary>
/// Place an order for a pet
/// </summary>
@@ -63,6 +82,16 @@ namespace IO.Swagger.Api
/// <returns>Order</returns>
Order GetOrderById (string orderId);
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
/// </remarks>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>ApiResponse< Order ></returns>
ApiResponse<Order> GetOrderByIdWithHttpInfo (string orderId);
/// <summary>
/// Find purchase order by ID
/// </summary>
@@ -83,6 +112,16 @@ namespace IO.Swagger.Api
/// <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>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
/// <summary>
/// Delete purchase order by ID
/// </summary>
@@ -138,16 +177,6 @@ namespace IO.Swagger.Api
/// <value>An instance of the Configuration</value>
public Configuration Configuration {get; set;}
/// <summary>
/// Gets the status code of the previous request
/// </summary>
public int StatusCode { get; private set; }
/// <summary>
/// Gets the response headers of the previous request
/// </summary>
public Dictionary<String, String> ResponseHeaders { get; private set; }
private readonly Dictionary<String, String> _defaultHeaderMap = new Dictionary<String, String>();
/// <summary>
@@ -173,8 +202,18 @@ namespace IO.Swagger.Api
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns></returns>
/// <returns></returns>
public Dictionary<string, int?> GetInventory ()
{
ApiResponse<Dictionary<string, int?>> response = GetInventoryWithHttpInfo();
return response.Data;
}
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns></returns>
public ApiResponse< Dictionary<string, int?> > GetInventoryWithHttpInfo ()
{
@@ -217,15 +256,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetInventory: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage);
return (Dictionary<string, int?>) Configuration.ApiClient.Deserialize(response, typeof(Dictionary<string, int?>));
return new ApiResponse<Dictionary<string, int?>>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Dictionary<string, int?>) Configuration.ApiClient.Deserialize(response, typeof(Dictionary<string, int?>)));
}
/// <summary>
@@ -275,11 +316,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetInventory: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage);
return (Dictionary<string, int?>) Configuration.ApiClient.Deserialize(response, typeof(Dictionary<string, int?>));
}
@@ -288,8 +330,19 @@ namespace IO.Swagger.Api
/// Place an order for a pet
/// </summary>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
/// <returns>Order</returns>
public Order PlaceOrder (Order body = null)
{
ApiResponse<Order> response = PlaceOrderWithHttpInfo(body);
return response.Data;
}
/// <summary>
/// Place an order for a pet
/// </summary>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null)
{
@@ -325,15 +378,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage);
return (Order) Configuration.ApiClient.Deserialize(response, typeof(Order));
return new ApiResponse<Order>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(response, typeof(Order)));
}
/// <summary>
@@ -377,11 +432,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage);
return (Order) Configuration.ApiClient.Deserialize(response, typeof(Order));
}
@@ -390,8 +446,19 @@ namespace IO.Swagger.Api
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
/// </summary>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
/// <returns>Order</returns>
public Order GetOrderById (string orderId)
{
ApiResponse<Order> response = GetOrderByIdWithHttpInfo(orderId);
return response.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>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
@@ -430,15 +497,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetOrderById: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage);
return (Order) Configuration.ApiClient.Deserialize(response, typeof(Order));
return new ApiResponse<Order>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(response, typeof(Order)));
}
/// <summary>
@@ -484,11 +553,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetOrderById: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage);
return (Order) Configuration.ApiClient.Deserialize(response, typeof(Order));
}
@@ -497,8 +567,18 @@ namespace IO.Swagger.Api
/// 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>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
/// <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>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
public ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId)
{
// verify the required parameter 'orderId' is set
@@ -537,15 +617,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -591,11 +673,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeleteOrder: " + response.ErrorMessage, response.ErrorMessage);
return;

View File

@@ -25,6 +25,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void CreateUser (User body = null);
/// <summary>
/// Create user
/// </summary>
/// <remarks>
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="body">Created user object</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> CreateUserWithHttpInfo (User body = null);
/// <summary>
/// Create user
/// </summary>
@@ -45,6 +55,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void CreateUsersWithArrayInput (List<User> body = null);
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -65,6 +85,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void CreateUsersWithListInput (List<User> body = null);
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -86,6 +116,17 @@ namespace IO.Swagger.Api
/// <returns>string</returns>
string LoginUser (string username = null, string password = null);
/// <summary>
/// Logs user into the system
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>ApiResponse< string ></returns>
ApiResponse<string> LoginUserWithHttpInfo (string username = null, string password = null);
/// <summary>
/// Logs user into the system
/// </summary>
@@ -106,6 +147,15 @@ namespace IO.Swagger.Api
/// <returns></returns>
void LogoutUser ();
/// <summary>
/// Logs out current logged in user session
/// </summary>
/// <remarks>
///
/// </remarks>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> LogoutUserWithHttpInfo ();
/// <summary>
/// Logs out current logged in user session
/// </summary>
@@ -125,6 +175,16 @@ namespace IO.Swagger.Api
/// <returns>User</returns>
User GetUserByName (string username);
/// <summary>
/// Get user by user name
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>ApiResponse< User ></returns>
ApiResponse<User> GetUserByNameWithHttpInfo (string username);
/// <summary>
/// Get user by user name
/// </summary>
@@ -146,6 +206,17 @@ namespace IO.Swagger.Api
/// <returns></returns>
void UpdateUser (string username, User body = null);
/// <summary>
/// Updated user
/// </summary>
/// <remarks>
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null);
/// <summary>
/// Updated user
/// </summary>
@@ -167,6 +238,16 @@ namespace IO.Swagger.Api
/// <returns></returns>
void DeleteUser (string username);
/// <summary>
/// Delete user
/// </summary>
/// <remarks>
/// This can only be done by the logged in user.
/// </remarks>
/// <param name="username">The name that needs to be deleted</param>
/// <returns>ApiResponse<Object></returns>
ApiResponse<Object> DeleteUserWithHttpInfo (string username);
/// <summary>
/// Delete user
/// </summary>
@@ -222,16 +303,6 @@ namespace IO.Swagger.Api
/// <value>An instance of the Configuration</value>
public Configuration Configuration {get; set;}
/// <summary>
/// Gets the status code of the previous request
/// </summary>
public int StatusCode { get; private set; }
/// <summary>
/// Gets the response headers of the previous request
/// </summary>
public Dictionary<String, String> ResponseHeaders { get; private set; }
private readonly Dictionary<String, String> _defaultHeaderMap = new Dictionary<String, String>();
/// <summary>
@@ -258,8 +329,18 @@ namespace IO.Swagger.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <param name="body">Created user object</param>
/// <returns></returns>
/// <returns></returns>
public void CreateUser (User body = null)
{
CreateUserWithHttpInfo(body);
}
/// <summary>
/// Create user This can only be done by the logged in user.
/// </summary>
/// <param name="body">Created user object</param>
/// <returns></returns>
public ApiResponse<Object> CreateUserWithHttpInfo (User body = null)
{
@@ -295,15 +376,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -347,11 +430,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUser: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -361,8 +445,18 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
/// <returns></returns>
public void CreateUsersWithArrayInput (List<User> body = null)
{
CreateUsersWithArrayInputWithHttpInfo(body);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null)
{
@@ -398,15 +492,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -450,11 +546,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUsersWithArrayInput: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -464,8 +561,18 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
/// <returns></returns>
public void CreateUsersWithListInput (List<User> body = null)
{
CreateUsersWithListInputWithHttpInfo(body);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null)
{
@@ -501,15 +608,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -553,11 +662,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling CreateUsersWithListInput: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -568,8 +678,20 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
/// <returns>string</returns>
public string LoginUser (string username = null, string password = null)
{
ApiResponse<string> response = LoginUserWithHttpInfo(username, password);
return response.Data;
}
/// <summary>
/// Logs user into the system
/// </summary>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
public ApiResponse< string > LoginUserWithHttpInfo (string username = null, string password = null)
{
@@ -606,15 +728,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling LoginUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage);
return (string) Configuration.ApiClient.Deserialize(response, typeof(string));
return new ApiResponse<string>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(string) Configuration.ApiClient.Deserialize(response, typeof(string)));
}
/// <summary>
@@ -660,11 +784,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling LoginUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage);
return (string) Configuration.ApiClient.Deserialize(response, typeof(string));
}
@@ -672,8 +797,17 @@ namespace IO.Swagger.Api
/// <summary>
/// Logs out current logged in user session
/// </summary>
/// <returns></returns>
/// <returns></returns>
public void LogoutUser ()
{
LogoutUserWithHttpInfo();
}
/// <summary>
/// Logs out current logged in user session
/// </summary>
/// <returns></returns>
public ApiResponse<Object> LogoutUserWithHttpInfo ()
{
@@ -708,15 +842,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling LogoutUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -758,11 +894,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling LogoutUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling LogoutUser: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -772,8 +909,19 @@ namespace IO.Swagger.Api
/// Get user by user name
/// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns>
/// <returns>User</returns>
public User GetUserByName (string username)
{
ApiResponse<User> response = GetUserByNameWithHttpInfo(username);
return response.Data;
}
/// <summary>
/// Get user by user name
/// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns>
public ApiResponse< User > GetUserByNameWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
@@ -812,15 +960,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetUserByName: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage);
return (User) Configuration.ApiClient.Deserialize(response, typeof(User));
return new ApiResponse<User>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(User) Configuration.ApiClient.Deserialize(response, typeof(User)));
}
/// <summary>
@@ -866,11 +1016,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling GetUserByName: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage);
return (User) Configuration.ApiClient.Deserialize(response, typeof(User));
}
@@ -880,8 +1031,19 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
/// <returns></returns>
public void UpdateUser (string username, User body = null)
{
UpdateUserWithHttpInfo(username, body);
}
/// <summary>
/// Updated user This can only be done by the logged in user.
/// </summary>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null)
{
// verify the required parameter 'username' is set
@@ -921,15 +1083,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdateUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -977,11 +1141,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling UpdateUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage);
return;
@@ -991,8 +1156,18 @@ namespace IO.Swagger.Api
/// Delete user This can only be done by the logged in user.
/// </summary>
/// <param name="username">The name that needs to be deleted</param>
/// <returns></returns>
/// <returns></returns>
public void DeleteUser (string username)
{
DeleteUserWithHttpInfo(username);
}
/// <summary>
/// Delete user This can only be done by the logged in user.
/// </summary>
/// <param name="username">The name that needs to be deleted</param>
/// <returns></returns>
public ApiResponse<Object> DeleteUserWithHttpInfo (string username)
{
// verify the required parameter 'username' is set
@@ -1031,15 +1206,17 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException (StatusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeleteUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage);
return;
return new ApiResponse<Object>(statusCode,
response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
@@ -1085,11 +1262,12 @@ namespace IO.Swagger.Api
// make the HTTP request
IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams);
StatusCode = (int) response.StatusCode;
ResponseHeaders = response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString());
int statusCode = (int) response.StatusCode;
if (StatusCode >= 400)
throw new ApiException (StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
if (statusCode >= 400)
throw new ApiException (statusCode, "Error calling DeleteUser: " + response.Content, response.Content);
else if (statusCode == 0)
throw new ApiException (statusCode, "Error calling DeleteUser: " + response.ErrorMessage, response.ErrorMessage);
return;

View File

@@ -12,19 +12,19 @@ namespace IO.Swagger.Client
/// Gets or sets the status code (HTTP status code)
/// </summary>
/// <value>The status code.</value>
public int StatusCode { get; set; }
public int StatusCode { get; private set; }
/// <summary>
/// Gets or sets the HTTP headers
/// </summary>
/// <value>HTTP headers</value>
public IDictionary<string, string> Headers { get; set; }
public IDictionary<string, string> Headers { get; private set; }
/// <summary>
/// Gets or sets the data (parsed HTTP body)
/// </summary>
/// <value>The data.</value>
public T Data { get; set; }
public T Data { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse"/> class.

View File

@@ -236,10 +236,10 @@ namespace SwaggerClient.TestPet
public void TestStatusCodeAndHeader ()
{
PetApi petApi = new PetApi ();
petApi.GetPetById (petId);
Assert.AreEqual (petApi.StatusCode, 200);
Assert.IsTrue (petApi.ResponseHeaders.ContainsKey("Content-Type"));
Assert.AreEqual (petApi.ResponseHeaders["Content-Type"], "application/json");
var response = petApi.GetPetByIdWithHttpInfo (petId);
Assert.AreEqual (response.StatusCode, 200);
Assert.IsTrue (response.Headers.ContainsKey("Content-Type"));
Assert.AreEqual (response.Headers["Content-Type"], "application/json");
}
}