use fully qualified name for Task

This commit is contained in:
wing328 2015-07-09 10:21:55 +08:00
parent e49fe7a12f
commit b8c06505f6
8 changed files with 44 additions and 50 deletions

View File

@ -7,7 +7,6 @@ using System.Web;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Extensions;
@ -111,7 +110,7 @@ namespace {{packageName}}.Client
/// <param name="fileParams">File parameters.</param>
/// <param name="authSettings">Authentication settings.</param>
/// <returns>The Task instance.</returns>
public async Task<Object> CallApiAsync(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
public async System.Threading.Tasks.Task<Object> CallApiAsync(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
Dictionary<String, String> headerParams, Dictionary<String, String> formParams, Dictionary<String, FileParameter> fileParams, String[] authSettings)
{

View File

@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Threading.Tasks;
using RestSharp;
using {{packageName}}.Client;
{{#hasImport}}using {{packageName}}.Model;
@ -25,7 +24,7 @@ namespace {{packageName}}.Api
/// </summary>
{{#allParams}}/// <param name="{{paramName}}">{{description}}</param>
{{/allParams}}/// <returns>{{#returnType}}{{{returnType}}}{{/returnType}}</returns>
{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
{{/operation}}
}
@ -134,7 +133,7 @@ namespace {{packageName}}.Api
/// </summary>
{{#allParams}}/// <param name="{{paramName}}">{{description}}</param>
{{/allParams}}/// <returns>{{#returnType}}{{{returnType}}}{{/returnType}}</returns>
{{#returnType}}public async Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}");

View File

@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Threading.Tasks;
using RestSharp;
using IO.Swagger.Client;
using IO.Swagger.Model;
@ -24,7 +23,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
Task UpdatePetAsync (Pet body);
System.Threading.Tasks.Task UpdatePetAsync (Pet body);
/// <summary>
/// Add a new pet to the store
@ -38,7 +37,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
Task AddPetAsync (Pet body);
System.Threading.Tasks.Task AddPetAsync (Pet body);
/// <summary>
/// Finds Pets by status Multiple status values can be provided with comma seperated strings
@ -52,7 +51,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns>List<Pet></returns>
Task<List<Pet>> FindPetsByStatusAsync (List<string> status);
System.Threading.Tasks.Task<List<Pet>> FindPetsByStatusAsync (List<string> status);
/// <summary>
/// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
@ -66,7 +65,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns>List<Pet></returns>
Task<List<Pet>> FindPetsByTagsAsync (List<string> tags);
System.Threading.Tasks.Task<List<Pet>> FindPetsByTagsAsync (List<string> tags);
/// <summary>
/// Find pet by ID Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions
@ -80,7 +79,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <returns>Pet</returns>
Task<Pet> GetPetByIdAsync (long? petId);
System.Threading.Tasks.Task<Pet> GetPetByIdAsync (long? petId);
/// <summary>
/// Updates a pet in the store with form data
@ -98,7 +97,7 @@ namespace IO.Swagger.Api
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <returns></returns>
Task UpdatePetWithFormAsync (string petId, string name, string status);
System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name, string status);
/// <summary>
/// Deletes a pet
@ -114,7 +113,7 @@ namespace IO.Swagger.Api
/// <param name="apiKey"></param>
/// <param name="petId">Pet id to delete</param>
/// <returns></returns>
Task DeletePetAsync (string apiKey, long? petId);
System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId);
/// <summary>
/// uploads an image
@ -132,7 +131,7 @@ namespace IO.Swagger.Api
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
/// <returns></returns>
Task UploadFileAsync (long? petId, string additionalMetadata, Stream file);
System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata, Stream file);
}
@ -234,7 +233,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public async Task UpdatePetAsync (Pet body)
public async System.Threading.Tasks.Task UpdatePetAsync (Pet body)
{
@ -310,7 +309,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
public async Task AddPetAsync (Pet body)
public async System.Threading.Tasks.Task AddPetAsync (Pet body)
{
@ -386,7 +385,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="status">Status values that need to be considered for filter</param>
/// <returns>List<Pet></returns>
public async Task<List<Pet>> FindPetsByStatusAsync (List<string> status)
public async System.Threading.Tasks.Task<List<Pet>> FindPetsByStatusAsync (List<string> status)
{
@ -461,7 +460,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="tags">Tags to filter by</param>
/// <returns>List<Pet></returns>
public async Task<List<Pet>> FindPetsByTagsAsync (List<string> tags)
public async System.Threading.Tasks.Task<List<Pet>> FindPetsByTagsAsync (List<string> tags)
{
@ -539,7 +538,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <returns>Pet</returns>
public async Task<Pet> GetPetByIdAsync (long? petId)
public async System.Threading.Tasks.Task<Pet> GetPetByIdAsync (long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById");
@ -625,7 +624,7 @@ namespace IO.Swagger.Api
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <returns></returns>
public async Task UpdatePetWithFormAsync (string petId, string name, string status)
public async System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name, string status)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm");
@ -711,7 +710,7 @@ namespace IO.Swagger.Api
/// <param name="apiKey"></param>
/// <param name="petId">Pet id to delete</param>
/// <returns></returns>
public async Task DeletePetAsync (string apiKey, long? petId)
public async System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet");
@ -799,7 +798,7 @@ namespace IO.Swagger.Api
/// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param>
/// <returns></returns>
public async Task UploadFileAsync (long? petId, string additionalMetadata, Stream file)
public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata, Stream file)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile");

View File

@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Threading.Tasks;
using RestSharp;
using IO.Swagger.Client;
using IO.Swagger.Model;
@ -22,7 +21,7 @@ namespace IO.Swagger.Api
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns>Dictionary<String, int?></returns>
Task<Dictionary<String, int?>> GetInventoryAsync ();
System.Threading.Tasks.Task<Dictionary<String, int?>> GetInventoryAsync ();
/// <summary>
/// Place an order for a pet
@ -36,7 +35,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Task<Order> PlaceOrderAsync (Order body);
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions
@ -50,7 +49,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
Task<Order> GetOrderByIdAsync (string orderId);
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (string 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
@ -64,7 +63,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
Task DeleteOrderAsync (string orderId);
System.Threading.Tasks.Task DeleteOrderAsync (string orderId);
}
@ -163,7 +162,7 @@ namespace IO.Swagger.Api
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
/// <returns>Dictionary<String, int?></returns>
public async Task<Dictionary<String, int?>> GetInventoryAsync ()
public async System.Threading.Tasks.Task<Dictionary<String, int?>> GetInventoryAsync ()
{
@ -237,7 +236,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public async Task<Order> PlaceOrderAsync (Order body)
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
{
@ -315,7 +314,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Order</returns>
public async Task<Order> GetOrderByIdAsync (string orderId)
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById");
@ -395,7 +394,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <returns></returns>
public async Task DeleteOrderAsync (string orderId)
public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder");

View File

@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Threading.Tasks;
using RestSharp;
using IO.Swagger.Client;
using IO.Swagger.Model;
@ -24,7 +23,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Created user object</param>
/// <returns></returns>
Task CreateUserAsync (User body);
System.Threading.Tasks.Task CreateUserAsync (User body);
/// <summary>
/// Creates list of users with given input array
@ -38,7 +37,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
Task CreateUsersWithArrayInputAsync (List<User> body);
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
/// <summary>
/// Creates list of users with given input array
@ -52,7 +51,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
Task CreateUsersWithListInputAsync (List<User> body);
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
/// <summary>
/// Logs user into the system
@ -68,7 +67,7 @@ namespace IO.Swagger.Api
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
Task<string> LoginUserAsync (string username, string password);
System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password);
/// <summary>
/// Logs out current logged in user session
@ -80,7 +79,7 @@ namespace IO.Swagger.Api
/// Logs out current logged in user session
/// </summary>
/// <returns></returns>
Task LogoutUserAsync ();
System.Threading.Tasks.Task LogoutUserAsync ();
/// <summary>
/// Get user by user name
@ -94,7 +93,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <returns>User</returns>
Task<User> GetUserByNameAsync (string username);
System.Threading.Tasks.Task<User> GetUserByNameAsync (string username);
/// <summary>
/// Updated user This can only be done by the logged in user.
@ -110,7 +109,7 @@ namespace IO.Swagger.Api
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
Task UpdateUserAsync (string username, User body);
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
/// <summary>
/// Delete user This can only be done by the logged in user.
@ -124,7 +123,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">The name that needs to be deleted</param>
/// <returns></returns>
Task DeleteUserAsync (string username);
System.Threading.Tasks.Task DeleteUserAsync (string username);
}
@ -226,7 +225,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">Created user object</param>
/// <returns></returns>
public async Task CreateUserAsync (User body)
public async System.Threading.Tasks.Task CreateUserAsync (User body)
{
@ -302,7 +301,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
public async Task CreateUsersWithArrayInputAsync (List<User> body)
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
{
@ -378,7 +377,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="body">List of user object</param>
/// <returns></returns>
public async Task CreateUsersWithListInputAsync (List<User> body)
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
{
@ -457,7 +456,7 @@ namespace IO.Swagger.Api
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
public async Task<string> LoginUserAsync (string username, string password)
public async System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password)
{
@ -530,7 +529,7 @@ namespace IO.Swagger.Api
/// Logs out current logged in user session
/// </summary>
/// <returns></returns>
public async Task LogoutUserAsync ()
public async System.Threading.Tasks.Task LogoutUserAsync ()
{
@ -608,7 +607,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <returns>User</returns>
public async Task<User> GetUserByNameAsync (string username)
public async System.Threading.Tasks.Task<User> GetUserByNameAsync (string username)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName");
@ -691,7 +690,7 @@ namespace IO.Swagger.Api
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
public async Task UpdateUserAsync (string username, User body)
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser");
@ -773,7 +772,7 @@ namespace IO.Swagger.Api
/// </summary>
/// <param name="username">The name that needs to be deleted</param>
/// <returns></returns>
public async Task DeleteUserAsync (string username)
public async System.Threading.Tasks.Task DeleteUserAsync (string username)
{
// verify the required parameter 'username' is set
if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser");

View File

@ -7,7 +7,6 @@ using System.Web;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Extensions;
@ -111,7 +110,7 @@ namespace IO.Swagger.Client
/// <param name="fileParams">File parameters.</param>
/// <param name="authSettings">Authentication settings.</param>
/// <returns>The Task instance.</returns>
public async Task<Object> CallApiAsync(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
public async System.Threading.Tasks.Task<Object> CallApiAsync(String path, RestSharp.Method method, Dictionary<String, String> queryParams, String postBody,
Dictionary<String, String> headerParams, Dictionary<String, String> formParams, Dictionary<String, FileParameter> fileParams, String[] authSettings)
{