diff --git a/bin/all-petstore.sh b/bin/all-petstore.sh
index 72797973a3..8937200c77 100755
--- a/bin/all-petstore.sh
+++ b/bin/all-petstore.sh
@@ -25,6 +25,7 @@ cd $APP_DIR
./bin/jaxrs-petstore-server.sh
./bin/java-petstore.sh
./bin/qt5-petstore.sh
+./bin/perl-petstore.sh
./bin/php-petstore.sh
./bin/python-petstore.sh
./bin/retrofit-petstore.sh
diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
index 117446441f..e22d5517ab 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
@@ -164,7 +164,7 @@ namespace {{package}} {
if (((int)response.StatusCode) >= 400) {
throw new ApiException ((int)response.StatusCode, "Error calling {{nickname}}: " + response.Content, response.Content);
}
- {{#returnType}}return ({{{returnType}}}) ApiInvoker.Deserialize(response.Content, typeof({{{returnType}}}));{{/returnType}}{{^returnType}}
+ {{#returnType}}return ({{{returnType}}}) apiClient.Deserialize(response.Content, typeof({{{returnType}}}));{{/returnType}}{{^returnType}}
return;{{/returnType}}
}
{{/operation}}
diff --git a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs
index 4d99ab9e53..5fdb38f2da 100644
--- a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs
+++ b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/PetApi.cs
@@ -6,1035 +6,803 @@ using IO.Swagger.Client;
using IO.Swagger.Model;
namespace IO.Swagger.Api {
+
- public interface IPetApi {
+ public interface IPetApi {
- ///
-
- /// Update an existing pet
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- void UpdatePet (Pet Body);
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ void UpdatePet (Pet Body);
- ///
-
- /// Update an existing pet
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- Task UpdatePetAsync (Pet Body);
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ Task UpdatePetAsync (Pet Body);
- ///
-
- /// Add a new pet to the store
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- void AddPet (Pet Body);
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ void AddPet (Pet Body);
- ///
-
- /// Add a new pet to the store
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- Task AddPetAsync (Pet Body);
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ Task AddPetAsync (Pet Body);
- ///
-
- /// Finds Pets by status Multiple status values can be provided with comma seperated strings
- ///
-
- ///
- Status values that need to be considered for filter
- ///
- List
- List FindPetsByStatus (List Status);
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma seperated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List
+ List FindPetsByStatus (List Status);
- ///
-
- /// Finds Pets by status Multiple status values can be provided with comma seperated strings
- ///
-
- ///
- Status values that need to be considered for filter
- ///
- List
- Task> FindPetsByStatusAsync (List Status);
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma seperated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List
+ Task> FindPetsByStatusAsync (List Status);
- ///
-
- /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
- ///
-
- ///
- Tags to filter by
- ///
- List
- List FindPetsByTags (List Tags);
+ ///
+ /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List
+ List FindPetsByTags (List Tags);
- ///
-
- /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
- ///
-
- ///
- Tags to filter by
- ///
- List
- Task> FindPetsByTagsAsync (List Tags);
+ ///
+ /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List
+ Task> FindPetsByTagsAsync (List Tags);
- ///
-
- /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Pet
- Pet GetPetById (long? PetId);
+ ///
+ /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Pet
+ Pet GetPetById (long? PetId);
- ///
-
- /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Pet
- Task GetPetByIdAsync (long? PetId);
+ ///
+ /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Pet
+ Task GetPetByIdAsync (long? PetId);
- ///
-
- /// Updates a pet in the store with form data
- ///
-
- ///
- ID of pet that needs to be updated///
- Updated name of the pet///
- Updated status of the pet
- ///
-
- void UpdatePetWithForm (string PetId, string Name, string Status);
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated/// Updated name of the pet/// Updated status of the pet
+ ///
+ void UpdatePetWithForm (string PetId, string Name, string Status);
- ///
-
- /// Updates a pet in the store with form data
- ///
-
- ///
- ID of pet that needs to be updated///
- Updated name of the pet///
- Updated status of the pet
- ///
-
- Task UpdatePetWithFormAsync (string PetId, string Name, string Status);
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated/// Updated name of the pet/// Updated status of the pet
+ ///
+ Task UpdatePetWithFormAsync (string PetId, string Name, string Status);
- ///
-
- /// Deletes a pet
- ///
-
- ///
- ///
- Pet id to delete
- ///
-
- void DeletePet (string ApiKey, long? PetId);
+ ///
+ /// Deletes a pet
+ ///
+ /// /// Pet id to delete
+ ///
+ void DeletePet (string ApiKey, long? PetId);
- ///
-
- /// Deletes a pet
- ///
-
- ///
- ///
- Pet id to delete
- ///
-
- Task DeletePetAsync (string ApiKey, long? PetId);
+ ///
+ /// Deletes a pet
+ ///
+ /// /// Pet id to delete
+ ///
+ Task DeletePetAsync (string ApiKey, long? PetId);
- ///
-
- /// uploads an image
- ///
-
- ///
- ID of pet to update///
- Additional data to pass to server///
- file to upload
- ///
-
- void UploadFile (long? PetId, string AdditionalMetadata, string File);
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update/// Additional data to pass to server/// file to upload
+ ///
+ void UploadFile (long? PetId, string AdditionalMetadata, string File);
- ///
-
- /// uploads an image
- ///
-
- ///
- ID of pet to update///
- Additional data to pass to server///
- file to upload
- ///
-
- Task UploadFileAsync (long? PetId, string AdditionalMetadata, string File);
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update/// Additional data to pass to server/// file to upload
+ ///
+ Task UploadFileAsync (long? PetId, string AdditionalMetadata, string File);
- }
+ }
- ///
-
- /// Represents a collection of functions to interact with the API endpoints
- ///
-
- public class PetApi : IPetApi {
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class PetApi : IPetApi {
- ///
-
- /// Initializes a new instance of the
-
- class.
- ///
-
- ///
- an instance of ApiClient (optional)
- ///
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// an instance of ApiClient (optional)
+ ///
public PetApi(ApiClient apiClient = null) {
- if (apiClient == null) { // use the default one in Configuration
- this.apiClient = Configuration.apiClient;
- } else {
- this.apiClient = apiClient;
- }
+ if (apiClient == null) { // use the default one in Configuration
+ this.apiClient = Configuration.apiClient;
+ } else {
+ this.apiClient = apiClient;
+ }
}
- ///
-
- /// Initializes a new instance of the
-
- class.
- ///
-
- ///
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
public PetApi(String basePath)
{
- this.apiClient = new ApiClient(basePath);
+ this.apiClient = new ApiClient(basePath);
}
- ///
-
- /// Sets the base path of the API client.
- ///
-
- ///
- The base path
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
public void SetBasePath(String basePath) {
- this.apiClient.basePath = basePath;
+ this.apiClient.basePath = basePath;
}
- ///
-
- /// Gets the base path of the API client.
- ///
-
- ///
- The base path
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
public String GetBasePath(String basePath) {
- return this.apiClient.basePath;
+ return this.apiClient.basePath;
}
- ///
-
- /// Gets or sets the API client.
- ///
-
- ///
- The API client
+ ///
+ /// Gets or sets the API client.
+ ///
+ /// The API client
public ApiClient apiClient {get; set;}
- ///
-
- /// Update an existing pet
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- public void UpdatePet (Pet Body) {
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public void UpdatePet (Pet Body) {
-
+
- var path = "/pet";
- path = path.Replace("{format}", "json");
-
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
+ if (((int)response.StatusCode) >= 400) {
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Update an existing pet
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- public async Task UpdatePetAsync (Pet Body) {
-
-
-
- var path = "/pet";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Add a new pet to the store
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- public void AddPet (Pet Body) {
-
-
-
- var path = "/pet";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Add a new pet to the store
- ///
-
- ///
- Pet object that needs to be added to the store
- ///
-
- public async Task AddPetAsync (Pet Body) {
-
-
-
- var path = "/pet";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Finds Pets by status Multiple status values can be provided with comma seperated strings
- ///
-
- ///
- Status values that need to be considered for filter
- ///
- List
- public List FindPetsByStatus (List Status) {
-
-
-
- var path = "/pet/findByStatus";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
- if (Status != null) queryParams.Add("status", apiClient.ParameterToString(Status)); // query parameter
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
- }
- return (List) apiClient.Deserialize(response.Content, typeof(List));
- }
-
- ///
-
- /// Finds Pets by status Multiple status values can be provided with comma seperated strings
- ///
-
- ///
- Status values that need to be considered for filter
- ///
- List
- public async Task> FindPetsByStatusAsync (List Status) {
-
-
-
- var path = "/pet/findByStatus";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
- if (Status != null) queryParams.Add("status", apiClient.ParameterToString(Status)); // query parameter
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
- }
- return (List) ApiInvoker.Deserialize(response.Content, typeof(List));
- }
-
- ///
-
- /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
- ///
-
- ///
- Tags to filter by
- ///
- List
- public List FindPetsByTags (List Tags) {
-
-
-
- var path = "/pet/findByTags";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
- if (Tags != null) queryParams.Add("tags", apiClient.ParameterToString(Tags)); // query parameter
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
- }
- return (List) apiClient.Deserialize(response.Content, typeof(List));
- }
-
- ///
-
- /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
- ///
-
- ///
- Tags to filter by
- ///
- List
- public async Task> FindPetsByTagsAsync (List Tags) {
-
-
-
- var path = "/pet/findByTags";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
- if (Tags != null) queryParams.Add("tags", apiClient.ParameterToString(Tags)); // query parameter
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
- }
- return (List) ApiInvoker.Deserialize(response.Content, typeof(List));
- }
-
- ///
-
- /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Pet
- public Pet GetPetById (long? PetId) {
-
-
- // verify the required parameter 'PetId' is set
- if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling GetPetById");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "api_key", "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
- }
- return (Pet) apiClient.Deserialize(response.Content, typeof(Pet));
- }
-
- ///
-
- /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Pet
- public async Task GetPetByIdAsync (long? PetId) {
-
-
- // verify the required parameter 'PetId' is set
- if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling GetPetById");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "api_key", "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
- }
- return (Pet) ApiInvoker.Deserialize(response.Content, typeof(Pet));
- }
-
- ///
-
- /// Updates a pet in the store with form data
- ///
-
- ///
- ID of pet that needs to be updated///
- Updated name of the pet///
- Updated status of the pet
- ///
-
- public void UpdatePetWithForm (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");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
- if (Name != null) formParams.Add("name", apiClient.ParameterToString(Name)); // form parameter
- if (Status != null) formParams.Add("status", apiClient.ParameterToString(Status)); // form parameter
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Updates a pet in the store with form data
- ///
-
- ///
- ID of pet that needs to be updated///
- Updated name of the pet///
- Updated status of the pet
- ///
-
- public async 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");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
- if (Name != null) formParams.Add("name", apiClient.ParameterToString(Name)); // form parameter
- if (Status != null) formParams.Add("status", apiClient.ParameterToString(Status)); // form parameter
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Deletes a pet
- ///
-
- ///
- ///
- Pet id to delete
- ///
-
- public void DeletePet (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");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
- if (ApiKey != null) headerParams.Add("api_key", apiClient.ParameterToString(ApiKey)); // header parameter
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Deletes a pet
- ///
-
- ///
- ///
- Pet id to delete
- ///
-
- public async 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");
-
-
- var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
- if (ApiKey != null) headerParams.Add("api_key", apiClient.ParameterToString(ApiKey)); // header parameter
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// uploads an image
- ///
-
- ///
- ID of pet to update///
- Additional data to pass to server///
- file to upload
- ///
-
- public void UploadFile (long? PetId, string AdditionalMetadata, string File) {
-
-
- // verify the required parameter 'PetId' is set
- if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling UploadFile");
-
-
- var path = "/pet/{petId}/uploadImage";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
- if (AdditionalMetadata != null) formParams.Add("additionalMetadata", apiClient.ParameterToString(AdditionalMetadata)); // form parameter
- if (File != null) fileParams.Add("file", File);
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// uploads an image
- ///
-
- ///
- ID of pet to update///
- Additional data to pass to server///
- file to upload
- ///
-
- public async Task UploadFileAsync (long? PetId, string AdditionalMetadata, string File) {
-
-
- // verify the required parameter 'PetId' is set
- if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling UploadFile");
-
-
- var path = "/pet/{petId}/uploadImage";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
- if (AdditionalMetadata != null) formParams.Add("additionalMetadata", apiClient.ParameterToString(AdditionalMetadata)); // form parameter
- if (File != null) fileParams.Add("file", File);
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "petstore_auth" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
- }
-
- return;
- }
-
+ }
+
+ return;
}
+
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public async Task UpdatePetAsync (Pet Body) {
+
+
+
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public void AddPet (Pet Body) {
+
+
+
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ ///
+ public async Task AddPetAsync (Pet Body) {
+
+
+
+ var path = "/pet";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma seperated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List
+ public List FindPetsByStatus (List Status) {
+
+
+
+ var path = "/pet/findByStatus";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (Status != null) queryParams.Add("status", apiClient.ParameterToString(Status)); // query parameter
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
+ }
+ return (List) apiClient.Deserialize(response.Content, typeof(List));
+ }
+
+ ///
+ /// Finds Pets by status Multiple status values can be provided with comma seperated strings
+ ///
+ /// Status values that need to be considered for filter
+ /// List
+ public async Task> FindPetsByStatusAsync (List Status) {
+
+
+
+ var path = "/pet/findByStatus";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (Status != null) queryParams.Add("status", apiClient.ParameterToString(Status)); // query parameter
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
+ }
+ return (List) apiClient.Deserialize(response.Content, typeof(List));
+ }
+
+ ///
+ /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List
+ public List FindPetsByTags (List Tags) {
+
+
+
+ var path = "/pet/findByTags";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (Tags != null) queryParams.Add("tags", apiClient.ParameterToString(Tags)); // query parameter
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
+ }
+ return (List) apiClient.Deserialize(response.Content, typeof(List));
+ }
+
+ ///
+ /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
+ ///
+ /// Tags to filter by
+ /// List
+ public async Task> FindPetsByTagsAsync (List Tags) {
+
+
+
+ var path = "/pet/findByTags";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+ if (Tags != null) queryParams.Add("tags", apiClient.ParameterToString(Tags)); // query parameter
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
+ }
+ return (List) apiClient.Deserialize(response.Content, typeof(List));
+ }
+
+ ///
+ /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Pet
+ public Pet GetPetById (long? PetId) {
+
+
+ // verify the required parameter 'PetId' is set
+ if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling GetPetById");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key", "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
+ }
+ return (Pet) apiClient.Deserialize(response.Content, typeof(Pet));
+ }
+
+ ///
+ /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Pet
+ public async Task GetPetByIdAsync (long? PetId) {
+
+
+ // verify the required parameter 'PetId' is set
+ if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling GetPetById");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key", "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
+ }
+ return (Pet) apiClient.Deserialize(response.Content, typeof(Pet));
+ }
+
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated/// Updated name of the pet/// Updated status of the pet
+ ///
+ public void UpdatePetWithForm (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");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+ if (Name != null) formParams.Add("name", apiClient.ParameterToString(Name)); // form parameter
+ if (Status != null) formParams.Add("status", apiClient.ParameterToString(Status)); // form parameter
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated/// Updated name of the pet/// Updated status of the pet
+ ///
+ public async 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");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+ if (Name != null) formParams.Add("name", apiClient.ParameterToString(Name)); // form parameter
+ if (Status != null) formParams.Add("status", apiClient.ParameterToString(Status)); // form parameter
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Deletes a pet
+ ///
+ /// /// Pet id to delete
+ ///
+ public void DeletePet (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");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ if (ApiKey != null) headerParams.Add("api_key", apiClient.ParameterToString(ApiKey)); // header parameter
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// Deletes a pet
+ ///
+ /// /// Pet id to delete
+ ///
+ public async 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");
+
+
+ var path = "/pet/{petId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+ if (ApiKey != null) headerParams.Add("api_key", apiClient.ParameterToString(ApiKey)); // header parameter
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update/// Additional data to pass to server/// file to upload
+ ///
+ public void UploadFile (long? PetId, string AdditionalMetadata, string File) {
+
+
+ // verify the required parameter 'PetId' is set
+ if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling UploadFile");
+
+
+ var path = "/pet/{petId}/uploadImage";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+ if (AdditionalMetadata != null) formParams.Add("additionalMetadata", apiClient.ParameterToString(AdditionalMetadata)); // form parameter
+ if (File != null) fileParams.Add("file", File);
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update/// Additional data to pass to server/// file to upload
+ ///
+ public async Task UploadFileAsync (long? PetId, string AdditionalMetadata, string File) {
+
+
+ // verify the required parameter 'PetId' is set
+ if (PetId == null) throw new ApiException(400, "Missing required parameter 'PetId' when calling UploadFile");
+
+
+ var path = "/pet/{petId}/uploadImage";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "petId" + "}", apiClient.ParameterToString(PetId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+ if (AdditionalMetadata != null) formParams.Add("additionalMetadata", apiClient.ParameterToString(AdditionalMetadata)); // form parameter
+ if (File != null) fileParams.Add("file", File);
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "petstore_auth" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
+ }
+
+ return;
+ }
+
+ }
+
}
diff --git a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/StoreApi.cs
index f77decdf5f..739c9d30be 100644
--- a/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/StoreApi.cs
+++ b/samples/client/petstore/csharp/src/main/csharp/io/swagger/Api/StoreApi.cs
@@ -6,535 +6,423 @@ using IO.Swagger.Client;
using IO.Swagger.Model;
namespace IO.Swagger.Api {
+
- public interface IStoreApi {
+ public interface IStoreApi {
- ///
-
- /// Returns pet inventories by status Returns a map of status codes to quantities
- ///
-
-
- ///
- Dictionary
- Dictionary GetInventory ();
-
- ///
-
- /// Returns pet inventories by status Returns a map of status codes to quantities
- ///
-
-
- ///
- Dictionary
- Task> GetInventoryAsync ();
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
- ///
-
- /// Place an order for a pet
- ///
-
- ///
- order placed for purchasing the pet
- ///
- Order
- Order PlaceOrder (Order Body);
+ /// Dictionary
+ Dictionary GetInventory ();
- ///
-
- /// Place an order for a pet
- ///
-
- ///
- order placed for purchasing the pet
- ///
- Order
- Task PlaceOrderAsync (Order Body);
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
- ///
-
- /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Order
- Order GetOrderById (string OrderId);
-
- ///
-
- /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Order
- Task GetOrderByIdAsync (string OrderId);
+ /// Dictionary
+ Task> GetInventoryAsync ();
- ///
-
- /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- ///
-
- ///
- ID of the order that needs to be deleted
- ///
-
- void DeleteOrder (string OrderId);
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ Order PlaceOrder (Order Body);
- ///
-
- /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- ///
-
- ///
- ID of the order that needs to be deleted
- ///
-
- Task DeleteOrderAsync (string OrderId);
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ Task PlaceOrderAsync (Order Body);
- }
+ ///
+ /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Order
+ Order GetOrderById (string OrderId);
- ///
-
- /// Represents a collection of functions to interact with the API endpoints
- ///
-
- public class StoreApi : IStoreApi {
+ ///
+ /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Order
+ Task GetOrderByIdAsync (string OrderId);
+
+ ///
+ /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ ///
+ /// ID of the order that needs to be deleted
+ ///
+ void DeleteOrder (string OrderId);
- ///
-
- /// Initializes a new instance of the
-
- class.
- ///
-
- ///
- an instance of ApiClient (optional)
- ///
-
+ ///
+ /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ ///
+ /// ID of the order that needs to be deleted
+ ///
+ Task DeleteOrderAsync (string OrderId);
+
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class StoreApi : IStoreApi {
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// an instance of ApiClient (optional)
+ ///
public StoreApi(ApiClient apiClient = null) {
- if (apiClient == null) { // use the default one in Configuration
- this.apiClient = Configuration.apiClient;
- } else {
- this.apiClient = apiClient;
- }
+ if (apiClient == null) { // use the default one in Configuration
+ this.apiClient = Configuration.apiClient;
+ } else {
+ this.apiClient = apiClient;
+ }
}
- ///
-
- /// Initializes a new instance of the
-
- class.
- ///
-
- ///
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
public StoreApi(String basePath)
{
- this.apiClient = new ApiClient(basePath);
+ this.apiClient = new ApiClient(basePath);
}
- ///
-
- /// Sets the base path of the API client.
- ///
-
- ///
- The base path
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
public void SetBasePath(String basePath) {
- this.apiClient.basePath = basePath;
+ this.apiClient.basePath = basePath;
}
- ///
-
- /// Gets the base path of the API client.
- ///
-
- ///
- The base path
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
public String GetBasePath(String basePath) {
- return this.apiClient.basePath;
+ return this.apiClient.basePath;
}
- ///
-
- /// Gets or sets the API client.
- ///
-
- ///
- The API client
+ ///
+ /// Gets or sets the API client.
+ ///
+ /// The API client
public ApiClient apiClient {get; set;}
- ///
-
- /// Returns pet inventories by status Returns a map of status codes to quantities
- ///
-
-
- ///
- Dictionary
- public Dictionary GetInventory () {
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
+
+ /// Dictionary
+ public Dictionary GetInventory () {
-
+
- var path = "/store/inventory";
- path = path.Replace("{format}", "json");
-
+ var path = "/store/inventory";
+ path = path.Replace("{format}", "json");
+
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
-
-
-
-
+
+
+
+
- // authentication setting, if any
- String[] authSettings = new String[] { "api_key" };
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key" };
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
+ if (((int)response.StatusCode) >= 400) {
throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
- }
- return (Dictionary) apiClient.Deserialize(response.Content, typeof(Dictionary));
- }
-
- ///
-
- /// Returns pet inventories by status Returns a map of status codes to quantities
- ///
-
-
- ///
- Dictionary
- public async Task> GetInventoryAsync () {
-
-
-
- var path = "/store/inventory";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { "api_key" };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
- }
- return (Dictionary) ApiInvoker.Deserialize(response.Content, typeof(Dictionary));
- }
-
- ///
-
- /// Place an order for a pet
- ///
-
- ///
- order placed for purchasing the pet
- ///
- Order
- public Order PlaceOrder (Order Body) {
-
-
-
- var path = "/store/order";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
- }
- return (Order) apiClient.Deserialize(response.Content, typeof(Order));
- }
-
- ///
-
- /// Place an order for a pet
- ///
-
- ///
- order placed for purchasing the pet
- ///
- Order
- public async Task PlaceOrderAsync (Order Body) {
-
-
-
- var path = "/store/order";
- path = path.Replace("{format}", "json");
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
- postBody = apiClient.Serialize(Body); // http body (model) parameter
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
- }
- return (Order) ApiInvoker.Deserialize(response.Content, typeof(Order));
- }
-
- ///
-
- /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Order
- public Order GetOrderById (string OrderId) {
-
-
- // verify the required parameter 'OrderId' is set
- if (OrderId == null) throw new ApiException(400, "Missing required parameter 'OrderId' when calling GetOrderById");
-
-
- var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", apiClient.ParameterToString(OrderId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
- }
- return (Order) apiClient.Deserialize(response.Content, typeof(Order));
- }
-
- ///
-
- /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- ///
-
- ///
- ID of pet that needs to be fetched
- ///
- Order
- public async Task GetOrderByIdAsync (string OrderId) {
-
-
- // verify the required parameter 'OrderId' is set
- if (OrderId == null) throw new ApiException(400, "Missing required parameter 'OrderId' when calling GetOrderById");
-
-
- var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", apiClient.ParameterToString(OrderId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
- }
- return (Order) ApiInvoker.Deserialize(response.Content, typeof(Order));
- }
-
- ///
-
- /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- ///
-
- ///
- ID of the order that needs to be deleted
- ///
-
- public void DeleteOrder (string OrderId) {
-
-
- // verify the required parameter 'OrderId' is set
- if (OrderId == null) throw new ApiException(400, "Missing required parameter 'OrderId' when calling DeleteOrder");
-
-
- var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", apiClient.ParameterToString(OrderId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
-
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
- }
-
- return;
- }
-
- ///
-
- /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- ///
-
- ///
- ID of the order that needs to be deleted
- ///
-
- public async 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");
-
-
- var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", apiClient.ParameterToString(OrderId));
-
-
- var queryParams = new Dictionary
- ();
- var headerParams = new Dictionary
- ();
- var formParams = new Dictionary
- ();
- var fileParams = new Dictionary
- ();
- String postBody = null;
-
-
-
-
-
-
- // authentication setting, if any
- String[] authSettings = new String[] { };
-
- // make the HTTP request
- IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
- if (((int)response.StatusCode) >= 400) {
- throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
- }
-
- return;
- }
-
+ }
+ return (Dictionary) apiClient.Deserialize(response.Content, typeof(Dictionary));
}
+
+ ///
+ /// Returns pet inventories by status Returns a map of status codes to quantities
+ ///
+
+ /// Dictionary
+ public async Task> GetInventoryAsync () {
+
+
+
+ var path = "/store/inventory";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { "api_key" };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
+ }
+ return (Dictionary) apiClient.Deserialize(response.Content, typeof(Dictionary));
+ }
+
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ public Order PlaceOrder (Order Body) {
+
+
+
+ var path = "/store/order";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) apiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
+ }
+ return (Order) apiClient.Deserialize(response.Content, typeof(Order));
+ }
+
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// Order
+ public async Task PlaceOrderAsync (Order Body) {
+
+
+
+ var path = "/store/order";
+ path = path.Replace("{format}", "json");
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary();
+ String postBody = null;
+
+
+
+
+ postBody = apiClient.Serialize(Body); // http body (model) parameter
+
+
+ // authentication setting, if any
+ String[] authSettings = new String[] { };
+
+ // make the HTTP request
+ IRestResponse response = (IRestResponse) await apiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ if (((int)response.StatusCode) >= 400) {
+ throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
+ }
+ return (Order) apiClient.Deserialize(response.Content, typeof(Order));
+ }
+
+ ///
+ /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ ///
+ /// ID of pet that needs to be fetched
+ /// Order
+ public Order GetOrderById (string OrderId) {
+
+
+ // verify the required parameter 'OrderId' is set
+ if (OrderId == null) throw new ApiException(400, "Missing required parameter 'OrderId' when calling GetOrderById");
+
+
+ var path = "/store/order/{orderId}";
+ path = path.Replace("{format}", "json");
+ path = path.Replace("{" + "orderId" + "}", apiClient.ParameterToString(OrderId));
+
+
+ var queryParams = new Dictionary();
+ var headerParams = new Dictionary();
+ var formParams = new Dictionary();
+ var fileParams = new Dictionary