diff --git a/bin/csharp-petstore.sh b/bin/csharp-petstore.sh index c3fe78f0f362..c042dd9c0cd0 100755 --- a/bin/csharp-petstore.sh +++ b/bin/csharp-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient" java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs index 76a0dac0944e..0da272b0a9e2 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/PetApiTests.cs @@ -65,18 +65,6 @@ namespace IO.Swagger.Test } - /// - /// Test AddPetUsingByteArray - /// - [Test] - public void AddPetUsingByteArrayTest() - { - // TODO: add unit test for the method 'AddPetUsingByteArray' - byte[] body = null; // TODO: replace null with proper value - instance.AddPetUsingByteArray(body); - - } - /// /// Test DeletePet /// @@ -126,30 +114,6 @@ string apiKey = null; // TODO: replace null with proper value Assert.IsInstanceOf (response, "response is Pet"); } - /// - /// Test GetPetByIdInObject - /// - [Test] - public void GetPetByIdInObjectTest() - { - // TODO: add unit test for the method 'GetPetByIdInObject' - long? petId = null; // TODO: replace null with proper value - var response = instance.GetPetByIdInObject(petId); - Assert.IsInstanceOf (response, "response is InlineResponse200"); - } - - /// - /// Test PetPetIdtestingByteArraytrueGet - /// - [Test] - public void PetPetIdtestingByteArraytrueGetTest() - { - // TODO: add unit test for the method 'PetPetIdtestingByteArraytrueGet' - long? petId = null; // TODO: replace null with proper value - var response = instance.PetPetIdtestingByteArraytrueGet(petId); - Assert.IsInstanceOf (response, "response is byte[]"); - } - /// /// Test UpdatePet /// @@ -169,7 +133,7 @@ string apiKey = null; // TODO: replace null with proper value public void UpdatePetWithFormTest() { // TODO: add unit test for the method 'UpdatePetWithForm' - string petId = null; // TODO: replace null with proper value + long? petId = null; // TODO: replace null with proper value string name = null; // TODO: replace null with proper value string status = null; // TODO: replace null with proper value instance.UpdatePetWithForm(petId, name, status); @@ -185,9 +149,9 @@ string status = null; // TODO: replace null with proper value // TODO: add unit test for the method 'UploadFile' long? petId = null; // TODO: replace null with proper value string additionalMetadata = null; // TODO: replace null with proper value -System.IO.Stream file = null; // TODO: replace null with proper value - instance.UploadFile(petId, additionalMetadata, file); - +Stream file = null; // TODO: replace null with proper value + var response = instance.UploadFile(petId, additionalMetadata, file); + Assert.IsInstanceOf (response, "response is ApiResponse"); } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs index 1d3e1c53815a..d1a0de454d6c 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient.Test/StoreApiTests.cs @@ -65,18 +65,6 @@ namespace IO.Swagger.Test } - /// - /// Test FindOrdersByStatus - /// - [Test] - public void FindOrdersByStatusTest() - { - // TODO: add unit test for the method 'FindOrdersByStatus' - string status = null; // TODO: replace null with proper value - var response = instance.FindOrdersByStatus(status); - Assert.IsInstanceOf> (response, "response is List"); - } - /// /// Test GetInventory /// @@ -88,17 +76,6 @@ namespace IO.Swagger.Test Assert.IsInstanceOf> (response, "response is Dictionary"); } - /// - /// Test GetInventoryInObject - /// - [Test] - public void GetInventoryInObjectTest() - { - // TODO: add unit test for the method 'GetInventoryInObject' - var response = instance.GetInventoryInObject(); - Assert.IsInstanceOf (response, "response is Object"); - } - /// /// Test GetOrderById /// @@ -106,7 +83,7 @@ namespace IO.Swagger.Test public void GetOrderByIdTest() { // TODO: add unit test for the method 'GetOrderById' - string orderId = null; // TODO: replace null with proper value + long? orderId = null; // TODO: replace null with proper value var response = instance.GetOrderById(orderId); Assert.IsInstanceOf (response, "response is Order"); } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs index 4b347121cb0a..c3fce248a2eb 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs @@ -21,9 +21,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// - void AddPet (Pet body = null); + void AddPet (Pet body); /// /// Add a new pet to the store @@ -32,30 +32,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet body = null); - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// - void AddPetUsingByteArray (byte[] body = null); - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// ApiResponse of Object(void) - ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null); + ApiResponse AddPetWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -86,9 +65,9 @@ namespace IO.Swagger.Api /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// List<Pet> - List FindPetsByStatus (List status = null); + List FindPetsByStatus (List status); /// /// Finds Pets by status @@ -97,38 +76,38 @@ namespace IO.Swagger.Api /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - ApiResponse> FindPetsByStatusWithHttpInfo (List status = null); + ApiResponse> FindPetsByStatusWithHttpInfo (List status); /// /// Finds Pets by tags /// /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// List<Pet> - List FindPetsByTags (List tags = null); + List FindPetsByTags (List tags); /// /// Finds Pets by tags /// /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// ApiResponse of List<Pet> - ApiResponse> FindPetsByTagsWithHttpInfo (List tags = null); + ApiResponse> FindPetsByTagsWithHttpInfo (List tags); /// /// Find pet by ID /// /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Pet Pet GetPetById (long? petId); @@ -136,64 +115,22 @@ namespace IO.Swagger.Api /// Find pet by ID /// /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// ApiResponse of Pet ApiResponse GetPetByIdWithHttpInfo (long? petId); /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// InlineResponse200 - InlineResponse200 GetPetByIdInObject (long? petId); - - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// ApiResponse of InlineResponse200 - ApiResponse GetPetByIdInObjectWithHttpInfo (long? petId); - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// byte[] - byte[] PetPetIdtestingByteArraytrueGet (long? petId); - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// ApiResponse of byte[] - ApiResponse PetPetIdtestingByteArraytrueGetWithHttpInfo (long? petId); - /// /// Update an existing pet /// /// /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet body = null); + void UpdatePet (Pet body); /// /// Update an existing pet @@ -202,9 +139,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet body = null); + ApiResponse UpdatePetWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -216,7 +153,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (string petId, string name = null, string status = null); + void UpdatePetWithForm (long? petId, string name = null, string status = null); /// /// Updates a pet in the store with form data @@ -229,7 +166,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); /// /// uploads an image /// @@ -240,8 +177,8 @@ namespace IO.Swagger.Api /// ID of pet to update /// Additional data to pass to server (optional) /// file to upload (optional) - /// - void UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + /// ApiResponse + ApiResponse UploadFile (long? petId, string additionalMetadata = null, Stream file = null); /// /// uploads an image @@ -253,8 +190,8 @@ namespace IO.Swagger.Api /// ID of pet to update /// Additional data to pass to server (optional) /// file to upload (optional) - /// ApiResponse of Object(void) - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -264,9 +201,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet body = null); + System.Threading.Tasks.Task AddPetAsync (Pet body); /// /// Add a new pet to the store @@ -275,30 +212,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body = null); - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// Task of void - System.Threading.Tasks.Task AddPetUsingByteArrayAsync (byte[] body = null); - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// - /// - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -329,9 +245,9 @@ namespace IO.Swagger.Api /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByStatusAsync (List status = null); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); /// /// Finds Pets by status @@ -340,38 +256,38 @@ namespace IO.Swagger.Api /// Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status = null); + System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status); /// /// Finds Pets by tags /// /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// Task of List<Pet> - System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags = null); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); /// /// Finds Pets by tags /// /// - /// Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// Task of ApiResponse (List<Pet>) - System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags = null); + System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags); /// /// Find pet by ID /// /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Task of Pet System.Threading.Tasks.Task GetPetByIdAsync (long? petId); @@ -379,64 +295,22 @@ namespace IO.Swagger.Api /// Find pet by ID /// /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Task of ApiResponse (Pet) System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of InlineResponse200 - System.Threading.Tasks.Task GetPetByIdInObjectAsync (long? petId); - - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of ApiResponse (InlineResponse200) - System.Threading.Tasks.Task> GetPetByIdInObjectAsyncWithHttpInfo (long? petId); - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of byte[] - System.Threading.Tasks.Task PetPetIdtestingByteArraytrueGetAsync (long? petId); - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' - /// - /// - /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of ApiResponse (byte[]) - System.Threading.Tasks.Task> PetPetIdtestingByteArraytrueGetAsyncWithHttpInfo (long? petId); - /// /// Update an existing pet /// /// /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet body = null); + System.Threading.Tasks.Task UpdatePetAsync (Pet body); /// /// Update an existing pet @@ -445,9 +319,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body = null); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -459,7 +333,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); /// /// Updates a pet in the store with form data @@ -472,20 +346,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (string petId, string name = null, string status = null); - /// - /// uploads an image - /// - /// - /// - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) - /// Task of void - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); - + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); /// /// uploads an image /// @@ -497,7 +358,20 @@ namespace IO.Swagger.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, Stream file = null); + + /// + /// uploads an image + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); #endregion Asynchronous Operations } @@ -592,9 +466,9 @@ namespace IO.Swagger.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// - public void AddPet (Pet body = null) + public void AddPet (Pet body) { AddPetWithHttpInfo(body); } @@ -603,10 +477,13 @@ namespace IO.Swagger.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse AddPetWithHttpInfo (Pet body = null) + public ApiResponse AddPetWithHttpInfo (Pet body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -625,8 +502,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -673,9 +550,9 @@ namespace IO.Swagger.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet body = null) + public async System.Threading.Tasks.Task AddPetAsync (Pet body) { await AddPetAsyncWithHttpInfo(body); @@ -685,10 +562,13 @@ namespace IO.Swagger.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body = null) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -707,8 +587,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -751,169 +631,6 @@ namespace IO.Swagger.Api null); } - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// - public void AddPetUsingByteArray (byte[] body = null) - { - AddPetUsingByteArrayWithHttpInfo(body); - } - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// ApiResponse of Object(void) - public ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null) - { - - var localVarPath = "/pet?testing_byte_array=true"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (body.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling AddPetUsingByteArray: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling AddPetUsingByteArray: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - null); - } - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// Task of void - public async System.Threading.Tasks.Task AddPetUsingByteArrayAsync (byte[] body = null) - { - await AddPetUsingByteArrayAsyncWithHttpInfo(body); - - } - - /// - /// Fake endpoint to test byte array in body parameter for adding a new pet to the store - /// - /// Thrown when fails to make API call - /// Pet object in the form of byte array (optional) - /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null) - { - - var localVarPath = "/pet?testing_byte_array=true"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (body.GetType() != typeof(byte[])) - { - localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - } - else - { - localVarPostBody = body; // byte array - } - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling AddPetUsingByteArray: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling AddPetUsingByteArray: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - null); - } - /// /// Deletes a pet /// @@ -954,8 +671,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1033,8 +750,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1075,9 +792,9 @@ namespace IO.Swagger.Api /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// List<Pet> - public List FindPetsByStatus (List status = null) + public List FindPetsByStatus (List status) { ApiResponse> localVarResponse = FindPetsByStatusWithHttpInfo(status); return localVarResponse.Data; @@ -1087,10 +804,13 @@ namespace IO.Swagger.Api /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status = null) + public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); var localVarPath = "/pet/findByStatus"; var localVarPathParams = new Dictionary(); @@ -1107,8 +827,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1148,9 +868,9 @@ namespace IO.Swagger.Api /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status = null) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) { ApiResponse> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status); return localVarResponse.Data; @@ -1161,10 +881,13 @@ namespace IO.Swagger.Api /// Finds Pets by status Multiple status values can be provided with comma separated strings /// /// Thrown when fails to make API call - /// Status values that need to be considered for query (optional, default to available) + /// Status values that need to be considered for filter /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status = null) + public async System.Threading.Tasks.Task>> FindPetsByStatusAsyncWithHttpInfo (List status) { + // verify the required parameter 'status' is set + if (status == null) + throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus"); var localVarPath = "/pet/findByStatus"; var localVarPathParams = new Dictionary(); @@ -1181,8 +904,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1219,25 +942,28 @@ namespace IO.Swagger.Api } /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// List<Pet> - public List FindPetsByTags (List tags = null) + public List FindPetsByTags (List tags) { ApiResponse> localVarResponse = FindPetsByTagsWithHttpInfo(tags); return localVarResponse.Data; } /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags = null) + public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); var localVarPath = "/pet/findByTags"; var localVarPathParams = new Dictionary(); @@ -1254,8 +980,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1292,12 +1018,12 @@ namespace IO.Swagger.Api } /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// Task of List<Pet> - public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags = null) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) { ApiResponse> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags); return localVarResponse.Data; @@ -1305,13 +1031,16 @@ namespace IO.Swagger.Api } /// - /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + /// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// /// Thrown when fails to make API call - /// Tags to filter by (optional) + /// Tags to filter by /// Task of ApiResponse (List<Pet>) - public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags = null) + public async System.Threading.Tasks.Task>> FindPetsByTagsAsyncWithHttpInfo (List tags) { + // verify the required parameter 'tags' is set + if (tags == null) + throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags"); var localVarPath = "/pet/findByTags"; var localVarPathParams = new Dictionary(); @@ -1328,8 +1057,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1366,10 +1095,10 @@ namespace IO.Swagger.Api } /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Pet public Pet GetPetById (long? petId) { @@ -1378,10 +1107,10 @@ namespace IO.Swagger.Api } /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// ApiResponse of Pet public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) { @@ -1404,8 +1133,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1416,12 +1145,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) { @@ -1448,10 +1171,10 @@ namespace IO.Swagger.Api } /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Task of Pet public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) { @@ -1461,10 +1184,10 @@ namespace IO.Swagger.Api } /// - /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// Find pet by ID Returns a single pet /// /// Thrown when fails to make API call - /// ID of pet that needs to be fetched + /// ID of pet to return /// Task of ApiResponse (Pet) public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) { @@ -1487,8 +1210,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1499,12 +1222,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } // authentication (api_key) required if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) { @@ -1529,341 +1246,13 @@ namespace IO.Swagger.Api } - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// InlineResponse200 - public InlineResponse200 GetPetByIdInObject (long? petId) - { - ApiResponse localVarResponse = GetPetByIdInObjectWithHttpInfo(petId); - return localVarResponse.Data; - } - - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// ApiResponse of InlineResponse200 - public ApiResponse< InlineResponse200 > GetPetByIdInObjectWithHttpInfo (long? petId) - { - // verify the required parameter 'petId' is set - if (petId == null) - throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdInObject"); - - var localVarPath = "/pet/{petId}?response=inline_arbitrary_object"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); - - } - - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of InlineResponse200 - public async System.Threading.Tasks.Task GetPetByIdInObjectAsync (long? petId) - { - ApiResponse localVarResponse = await GetPetByIdInObjectAsyncWithHttpInfo(petId); - return localVarResponse.Data; - - } - - /// - /// Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of ApiResponse (InlineResponse200) - public async System.Threading.Tasks.Task> GetPetByIdInObjectAsyncWithHttpInfo (long? petId) - { - // verify the required parameter 'petId' is set - if (petId == null) - throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdInObject"); - - var localVarPath = "/pet/{petId}?response=inline_arbitrary_object"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling GetPetByIdInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (InlineResponse200) Configuration.ApiClient.Deserialize(localVarResponse, typeof(InlineResponse200))); - - } - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// byte[] - public byte[] PetPetIdtestingByteArraytrueGet (long? petId) - { - ApiResponse localVarResponse = PetPetIdtestingByteArraytrueGetWithHttpInfo(petId); - return localVarResponse.Data; - } - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// ApiResponse of byte[] - public ApiResponse< byte[] > PetPetIdtestingByteArraytrueGetWithHttpInfo (long? petId) - { - // verify the required parameter 'petId' is set - if (petId == null) - throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->PetPetIdtestingByteArraytrueGet"); - - var localVarPath = "/pet/{petId}?testing_byte_array=true"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling PetPetIdtestingByteArraytrueGet: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling PetPetIdtestingByteArraytrueGet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of byte[] - public async System.Threading.Tasks.Task PetPetIdtestingByteArraytrueGetAsync (long? petId) - { - ApiResponse localVarResponse = await PetPetIdtestingByteArraytrueGetAsyncWithHttpInfo(petId); - return localVarResponse.Data; - - } - - /// - /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - /// - /// Thrown when fails to make API call - /// ID of pet that needs to be fetched - /// Task of ApiResponse (byte[]) - public async System.Threading.Tasks.Task> PetPetIdtestingByteArraytrueGetAsyncWithHttpInfo (long? petId) - { - // verify the required parameter 'petId' is set - if (petId == null) - throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->PetPetIdtestingByteArraytrueGet"); - - var localVarPath = "/pet/{petId}?testing_byte_array=true"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter - - // authentication (petstore_auth) required - // oauth required - if (!String.IsNullOrEmpty(Configuration.AccessToken)) - { - localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken; - } - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling PetPetIdtestingByteArraytrueGet: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling PetPetIdtestingByteArraytrueGet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (byte[]) Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); - - } - /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet body = null) + public void UpdatePet (Pet body) { UpdatePetWithHttpInfo(body); } @@ -1872,10 +1261,13 @@ namespace IO.Swagger.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithHttpInfo (Pet body = null) + public ApiResponse UpdatePetWithHttpInfo (Pet body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -1894,8 +1286,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1942,9 +1334,9 @@ namespace IO.Swagger.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet body = null) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) { await UpdatePetAsyncWithHttpInfo(body); @@ -1954,10 +1346,13 @@ namespace IO.Swagger.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store (optional) + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body = null) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "/pet"; var localVarPathParams = new Dictionary(); @@ -1976,8 +1371,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -2028,7 +1423,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (string petId, string name = null, string status = null) + public void UpdatePetWithForm (long? petId, string name = null, string status = null) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -2041,7 +1436,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -2063,8 +1458,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -2110,7 +1505,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -2124,7 +1519,7 @@ namespace IO.Swagger.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (string petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -2146,8 +1541,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -2192,10 +1587,11 @@ namespace IO.Swagger.Api /// ID of pet to update /// Additional data to pass to server (optional) /// file to upload (optional) - /// - public void UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + /// ApiResponse + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Stream file = null) { - UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + return localVarResponse.Data; } /// @@ -2205,8 +1601,8 @@ namespace IO.Swagger.Api /// ID of pet to update /// Additional data to pass to server (optional) /// file to upload (optional) - /// ApiResponse of Object(void) - public ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -2228,8 +1624,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -2261,24 +1656,10 @@ namespace IO.Swagger.Api else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - null); - } - - /// - /// uploads an image - /// - /// Thrown when fails to make API call - /// ID of pet to update - /// Additional data to pass to server (optional) - /// file to upload (optional) - /// Task of void - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) - { - await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); - + (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } /// @@ -2289,7 +1670,22 @@ namespace IO.Swagger.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, Stream file = null) + { + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + return localVarResponse.Data; + + } + + /// + /// uploads an image + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// Additional data to pass to server (optional) + /// file to upload (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -2311,8 +1707,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -2344,10 +1739,10 @@ namespace IO.Swagger.Api else if (localVarStatusCode == 0) throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - null); + (ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs index 224db89c53c0..28a5ff1afd73 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs @@ -36,27 +36,6 @@ namespace IO.Swagger.Api /// ApiResponse of Object(void) ApiResponse DeleteOrderWithHttpInfo (string orderId); /// - /// Finds orders by status - /// - /// - /// A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// List<Order> - List FindOrdersByStatus (string status = null); - - /// - /// Finds orders by status - /// - /// - /// A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// ApiResponse of List<Order> - ApiResponse> FindOrdersByStatusWithHttpInfo (string status = null); - /// /// Returns pet inventories by status /// /// @@ -76,25 +55,6 @@ namespace IO.Swagger.Api /// ApiResponse of Dictionary<string, int?> ApiResponse> GetInventoryWithHttpInfo (); /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' - /// - /// - /// Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Object - Object GetInventoryInObject (); - - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' - /// - /// - /// Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// ApiResponse of Object - ApiResponse GetInventoryInObjectWithHttpInfo (); - /// /// Find purchase order by ID /// /// @@ -103,7 +63,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (string orderId); + Order GetOrderById (long? orderId); /// /// Find purchase order by ID @@ -114,7 +74,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (string orderId); + ApiResponse GetOrderByIdWithHttpInfo (long? orderId); /// /// Place an order for a pet /// @@ -122,9 +82,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order body = null); + Order PlaceOrder (Order body); /// /// Place an order for a pet @@ -133,9 +93,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order body = null); + ApiResponse PlaceOrderWithHttpInfo (Order body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -160,27 +120,6 @@ namespace IO.Swagger.Api /// Task of ApiResponse System.Threading.Tasks.Task> DeleteOrderAsyncWithHttpInfo (string orderId); /// - /// Finds orders by status - /// - /// - /// A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// Task of List<Order> - System.Threading.Tasks.Task> FindOrdersByStatusAsync (string status = null); - - /// - /// Finds orders by status - /// - /// - /// A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// Task of ApiResponse (List<Order>) - System.Threading.Tasks.Task>> FindOrdersByStatusAsyncWithHttpInfo (string status = null); - /// /// Returns pet inventories by status /// /// @@ -200,25 +139,6 @@ namespace IO.Swagger.Api /// Task of ApiResponse (Dictionary<string, int?>) System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' - /// - /// - /// Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Task of Object - System.Threading.Tasks.Task GetInventoryInObjectAsync (); - - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' - /// - /// - /// Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (Object) - System.Threading.Tasks.Task> GetInventoryInObjectAsyncWithHttpInfo (); - /// /// Find purchase order by ID /// /// @@ -227,7 +147,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (string orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); /// /// Find purchase order by ID @@ -238,7 +158,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (string orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); /// /// Place an order for a pet /// @@ -246,9 +166,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order body = null); + System.Threading.Tasks.Task PlaceOrderAsync (Order body); /// /// Place an order for a pet @@ -257,9 +177,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body = null); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); #endregion Asynchronous Operations } @@ -388,8 +308,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -458,8 +378,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -489,163 +409,6 @@ namespace IO.Swagger.Api null); } - /// - /// Finds orders by status A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// List<Order> - public List FindOrdersByStatus (string status = null) - { - ApiResponse> localVarResponse = FindOrdersByStatusWithHttpInfo(status); - return localVarResponse.Data; - } - - /// - /// Finds orders by status A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// ApiResponse of List<Order> - public ApiResponse< List > FindOrdersByStatusWithHttpInfo (string status = null) - { - - var localVarPath = "/store/findByStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (test_api_client_id) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id"))) - { - localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id"); - } - - // authentication (test_api_client_secret) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"))) - { - localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"); - } - - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - - /// - /// Finds orders by status A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// Task of List<Order> - public async System.Threading.Tasks.Task> FindOrdersByStatusAsync (string status = null) - { - ApiResponse> localVarResponse = await FindOrdersByStatusAsyncWithHttpInfo(status); - return localVarResponse.Data; - - } - - /// - /// Finds orders by status A single status value can be provided as a string - /// - /// Thrown when fails to make API call - /// Status value that needs to be considered for query (optional, default to placed) - /// Task of ApiResponse (List<Order>) - public async System.Threading.Tasks.Task>> FindOrdersByStatusAsyncWithHttpInfo (string status = null) - { - - var localVarPath = "/store/findByStatus"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - if (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter - - // authentication (test_api_client_id) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id"))) - { - localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id"); - } - // authentication (test_api_client_secret) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"))) - { - localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (List) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); - - } - /// /// Returns pet inventories by status Returns a map of status codes to quantities /// @@ -680,8 +443,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -751,8 +513,7 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -786,153 +547,13 @@ namespace IO.Swagger.Api } - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Object - public Object GetInventoryInObject () - { - ApiResponse localVarResponse = GetInventoryInObjectWithHttpInfo(); - return localVarResponse.Data; - } - - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// ApiResponse of Object - public ApiResponse< Object > GetInventoryInObjectWithHttpInfo () - { - - var localVarPath = "/store/inventory?response=arbitrary_object"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); - - } - - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Task of Object - public async System.Threading.Tasks.Task GetInventoryInObjectAsync () - { - ApiResponse localVarResponse = await GetInventoryInObjectAsyncWithHttpInfo(); - return localVarResponse.Data; - - } - - /// - /// Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities - /// - /// Thrown when fails to make API call - /// Task of ApiResponse (Object) - public async System.Threading.Tasks.Task> GetInventoryInObjectAsyncWithHttpInfo () - { - - var localVarPath = "/store/inventory?response=arbitrary_object"; - var localVarPathParams = new Dictionary(); - var localVarQueryParams = new Dictionary(); - var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); - var localVarFormParams = new Dictionary(); - var localVarFileParams = new Dictionary(); - Object localVarPostBody = null; - - // to determine the Content-Type header - String[] localVarHttpContentTypes = new String[] { - }; - String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); - - // to determine the Accept header - String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" - }; - String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); - if (localVarHttpHeaderAccept != null) - localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - - // set "format" to json by default - // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json - localVarPathParams.Add("format", "json"); - - // authentication (api_key) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key"))) - { - localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key"); - } - - // make the HTTP request - IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, - Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, - localVarPathParams, localVarHttpContentType); - - int localVarStatusCode = (int) localVarResponse.StatusCode; - - if (localVarStatusCode >= 400) - throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content); - else if (localVarStatusCode == 0) - throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage); - - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object))); - - } - /// /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions /// /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (string orderId) + public Order GetOrderById (long? orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -944,7 +565,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId) + public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -965,8 +586,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -977,19 +598,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter - // authentication (test_api_key_query) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query"))) - { - localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query"); - } - - // authentication (test_api_key_header) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header"))) - { - localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header"); - } - - // make the HTTP request IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, @@ -1014,7 +622,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (string orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -1027,7 +635,7 @@ namespace IO.Swagger.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (string orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -1048,8 +656,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1060,17 +668,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter - // authentication (test_api_key_query) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query"))) - { - localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query"); - } - // authentication (test_api_key_header) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header"))) - { - localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header"); - } - // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, @@ -1093,9 +690,9 @@ namespace IO.Swagger.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order body = null) + public Order PlaceOrder (Order body) { ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); return localVarResponse.Data; @@ -1105,10 +702,13 @@ namespace IO.Swagger.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null) + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "/store/order"; var localVarPathParams = new Dictionary(); @@ -1125,8 +725,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1144,18 +744,6 @@ namespace IO.Swagger.Api localVarPostBody = body; // byte array } - // authentication (test_api_client_id) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id"))) - { - localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id"); - } - - // authentication (test_api_client_secret) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"))) - { - localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"); - } - // make the HTTP request IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, @@ -1179,9 +767,9 @@ namespace IO.Swagger.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order body = null) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) { ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1192,10 +780,13 @@ namespace IO.Swagger.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet (optional) + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body = null) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "/store/order"; var localVarPathParams = new Dictionary(); @@ -1212,8 +803,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1231,16 +822,6 @@ namespace IO.Swagger.Api localVarPostBody = body; // byte array } - // authentication (test_api_client_id) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id"))) - { - localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id"); - } - // authentication (test_api_client_secret) required - if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"))) - { - localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret"); - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs index d75732e4a4b3..a94b733e44bb 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs @@ -21,9 +21,9 @@ namespace IO.Swagger.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// - void CreateUser (User body = null); + void CreateUser (User body); /// /// Create user @@ -32,9 +32,9 @@ namespace IO.Swagger.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User body = null); + ApiResponse CreateUserWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -42,9 +42,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// - void CreateUsersWithArrayInput (List body = null); + void CreateUsersWithArrayInput (List body); /// /// Creates list of users with given input array @@ -53,9 +53,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body = null); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -63,9 +63,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// - void CreateUsersWithListInput (List body = null); + void CreateUsersWithListInput (List body); /// /// Creates list of users with given input array @@ -74,9 +74,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List body = null); + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); /// /// Delete user /// @@ -126,10 +126,10 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// string - string LoginUser (string username = null, string password = null); + string LoginUser (string username, string password); /// /// Logs user into the system @@ -138,10 +138,10 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// ApiResponse of string - ApiResponse LoginUserWithHttpInfo (string username = null, string password = null); + ApiResponse LoginUserWithHttpInfo (string username, string password); /// /// Logs out current logged in user session /// @@ -169,9 +169,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// - void UpdateUser (string username, User body = null); + void UpdateUser (string username, User body); /// /// Updated user @@ -181,9 +181,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User body = null); + ApiResponse UpdateUserWithHttpInfo (string username, User body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -193,9 +193,9 @@ namespace IO.Swagger.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User body = null); + System.Threading.Tasks.Task CreateUserAsync (User body); /// /// Create user @@ -204,9 +204,9 @@ namespace IO.Swagger.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body = null); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -214,9 +214,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body = null); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); /// /// Creates list of users with given input array @@ -225,9 +225,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body = null); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -235,9 +235,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body = null); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); /// /// Creates list of users with given input array @@ -246,9 +246,9 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body = null); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); /// /// Delete user /// @@ -298,10 +298,10 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// Task of string - System.Threading.Tasks.Task LoginUserAsync (string username = null, string password = null); + System.Threading.Tasks.Task LoginUserAsync (string username, string password); /// /// Logs user into the system @@ -310,10 +310,10 @@ namespace IO.Swagger.Api /// /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// Task of ApiResponse (string) - System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username = null, string password = null); + System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password); /// /// Logs out current logged in user session /// @@ -341,9 +341,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); /// /// Updated user @@ -353,9 +353,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body = null); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); #endregion Asynchronous Operations } @@ -450,9 +450,9 @@ namespace IO.Swagger.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// - public void CreateUser (User body = null) + public void CreateUser (User body) { CreateUserWithHttpInfo(body); } @@ -461,10 +461,13 @@ namespace IO.Swagger.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// ApiResponse of Object(void) - public ApiResponse CreateUserWithHttpInfo (User body = null) + public ApiResponse CreateUserWithHttpInfo (User body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "/user"; var localVarPathParams = new Dictionary(); @@ -481,8 +484,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -523,9 +526,9 @@ namespace IO.Swagger.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User body = null) + public async System.Threading.Tasks.Task CreateUserAsync (User body) { await CreateUserAsyncWithHttpInfo(body); @@ -535,10 +538,13 @@ namespace IO.Swagger.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object (optional) + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body = null) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "/user"; var localVarPathParams = new Dictionary(); @@ -555,8 +561,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -597,9 +603,9 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// - public void CreateUsersWithArrayInput (List body = null) + public void CreateUsersWithArrayInput (List body) { CreateUsersWithArrayInputWithHttpInfo(body); } @@ -608,10 +614,13 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body = null) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "/user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -628,8 +637,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -670,9 +679,9 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body = null) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) { await CreateUsersWithArrayInputAsyncWithHttpInfo(body); @@ -682,10 +691,13 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body = null) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "/user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -702,8 +714,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -744,9 +756,9 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// - public void CreateUsersWithListInput (List body = null) + public void CreateUsersWithListInput (List body) { CreateUsersWithListInputWithHttpInfo(body); } @@ -755,10 +767,13 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithListInputWithHttpInfo (List body = null) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "/user/createWithList"; var localVarPathParams = new Dictionary(); @@ -775,8 +790,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -817,9 +832,9 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body = null) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) { await CreateUsersWithListInputAsyncWithHttpInfo(body); @@ -829,10 +844,13 @@ namespace IO.Swagger.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object (optional) + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body = null) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "/user/createWithList"; var localVarPathParams = new Dictionary(); @@ -849,8 +867,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -925,8 +943,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -937,13 +955,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter - // authentication (test_http_basic) required - // http basic authentication required - if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) - { - localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); - } - // make the HTTP request IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath, @@ -1002,8 +1013,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1014,12 +1025,6 @@ namespace IO.Swagger.Api localVarPathParams.Add("format", "json"); if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter - // authentication (test_http_basic) required - // http basic authentication required - if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) - { - localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); - } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath, @@ -1078,8 +1083,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1149,8 +1154,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1184,10 +1189,10 @@ namespace IO.Swagger.Api /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// string - public string LoginUser (string username = null, string password = null) + public string LoginUser (string username, string password) { ApiResponse localVarResponse = LoginUserWithHttpInfo(username, password); return localVarResponse.Data; @@ -1197,11 +1202,17 @@ namespace IO.Swagger.Api /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username = null, string password = null) + public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); var localVarPath = "/user/login"; var localVarPathParams = new Dictionary(); @@ -1218,8 +1229,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1254,10 +1265,10 @@ namespace IO.Swagger.Api /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// Task of string - public async System.Threading.Tasks.Task LoginUserAsync (string username = null, string password = null) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) { ApiResponse localVarResponse = await LoginUserAsyncWithHttpInfo(username, password); return localVarResponse.Data; @@ -1268,11 +1279,17 @@ namespace IO.Swagger.Api /// Logs user into the system /// /// Thrown when fails to make API call - /// The user name for login (optional) - /// The password for login in clear text (optional) + /// The user name for login + /// The password for login in clear text /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username = null, string password = null) + public async System.Threading.Tasks.Task> LoginUserAsyncWithHttpInfo (string username, string password) { + // verify the required parameter 'username' is set + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser"); + // verify the required parameter 'password' is set + if (password == null) + throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser"); var localVarPath = "/user/login"; var localVarPathParams = new Dictionary(); @@ -1289,8 +1306,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1354,8 +1371,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1418,8 +1435,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1453,9 +1470,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// - public void UpdateUser (string username, User body = null) + public void UpdateUser (string username, User body) { UpdateUserWithHttpInfo(username, body); } @@ -1465,13 +1482,16 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// ApiResponse of Object(void) - public ApiResponse UpdateUserWithHttpInfo (string username, User body = null) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "/user/{username}"; var localVarPathParams = new Dictionary(); @@ -1488,8 +1508,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) @@ -1532,9 +1552,9 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) { await UpdateUserAsyncWithHttpInfo(username, body); @@ -1545,13 +1565,16 @@ namespace IO.Swagger.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object (optional) + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body = null) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "/user/{username}"; var localVarPathParams = new Dictionary(); @@ -1568,8 +1591,8 @@ namespace IO.Swagger.Api // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { - "application/json", - "application/xml" + "application/xml", + "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs new file mode 100644 index 000000000000..de8b24e69e98 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs @@ -0,0 +1,142 @@ +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace IO.Swagger.Model +{ + /// + /// + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + + /// + /// Initializes a new instance of the class. + /// Initializes a new instance of the class. + /// + /// Code. + /// Type. + /// Message. + + public ApiResponse(int? Code = null, string Type = null, string Message = null) + { + this.Code = Code; + this.Type = Type; + this.Message = Message; + + } + + + /// + /// Gets or Sets Code + /// + [DataMember(Name="code", EmitDefaultValue=false)] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type", EmitDefaultValue=false)] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message", EmitDefaultValue=false)] + public string Message { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class ApiResponse {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object obj) + { + // credit: http://stackoverflow.com/a/10454552/677735 + return this.Equals(obj as ApiResponse); + } + + /// + /// Returns true if ApiResponse instances are equal + /// + /// Instance of ApiResponse to be compared + /// Boolean + public bool Equals(ApiResponse other) + { + // credit: http://stackoverflow.com/a/10454552/677735 + if (other == null) + return false; + + return + ( + this.Code == other.Code || + this.Code != null && + this.Code.Equals(other.Code) + ) && + ( + this.Type == other.Type || + this.Type != null && + this.Type.Equals(other.Type) + ) && + ( + this.Message == other.Message || + this.Message != null && + this.Message.Equals(other.Message) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + // credit: http://stackoverflow.com/a/263416/677735 + unchecked // Overflow is fine, just wrap + { + int hash = 41; + // Suitable nullity checks etc, of course :) + if (this.Code != null) + hash = hash * 59 + this.Code.GetHashCode(); + if (this.Type != null) + hash = hash * 59 + this.Type.GetHashCode(); + if (this.Message != null) + hash = hash * 59 + this.Message.GetHashCode(); + return hash; + } + } + + } +} diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs index b5ce3f55c4c2..78276f0e3137 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs @@ -47,19 +47,29 @@ namespace IO.Swagger.Model /// Initializes a new instance of the class. /// Initializes a new instance of the class. /// + /// Id. /// PetId. /// Quantity. /// ShipDate. /// Order Status. - /// Complete. + /// Complete (default to false). - public Order(long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null) + public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null) { + this.Id = Id; this.PetId = PetId; this.Quantity = Quantity; this.ShipDate = ShipDate; this.Status = Status; - this.Complete = Complete; + // use default value if no "Complete" provided + if (Complete == null) + { + this.Complete = false; + } + else + { + this.Complete = Complete; + } } @@ -68,7 +78,7 @@ namespace IO.Swagger.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; private set; } + public long? Id { get; set; } /// /// Gets or Sets PetId diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj index 67c8e73b6e55..7b777ba6a271 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj @@ -70,6 +70,7 @@ + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs index f66e34a5e9e9..6af386ff2ba6 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs @@ -73,6 +73,9 @@ namespace SwaggerClientTest.TestOrder } + /* comment out the test case as the method is not defined in original petstore spec + * we will re-enable this after updating the petstore server + * /// /// Test GetInvetoryInObject /// @@ -93,7 +96,7 @@ namespace SwaggerClientTest.TestOrder Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value)); } - } + }*/ } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs index 0b04ca72b05f..25d2255542a7 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs @@ -158,6 +158,9 @@ namespace SwaggerClientTest.TestPet } + /* comment out the test case as the method is not defined in original petstore spec + * we will re-enable this after updating the petstore server + * /// /// Test GetPetByIdInObject /// @@ -187,8 +190,11 @@ namespace SwaggerClientTest.TestPet Assert.AreEqual (56, (int)category ["id"]); Assert.AreEqual ("sample category name2", (string) category["name"]); - } + }*/ + /* comment out the test case as the method is not defined in original petstore spec + * we will re-enable this after updating the petstore server + * /// /// Test GetPetByIdWithByteArray /// @@ -201,8 +207,11 @@ namespace SwaggerClientTest.TestPet PetApi petApi = new PetApi (c1); byte[] response = petApi.PetPetIdtestingByteArraytrueGet (petId); Assert.IsInstanceOf (response, "Response is byte array"); - } + }*/ + /* comment out the test case as the method is not defined in original petstore spec + * we will re-enable this after updating the petstore server + * /// /// Test AddPetUsingByteArray /// @@ -216,7 +225,7 @@ namespace SwaggerClientTest.TestPet Pet p = createPet (); byte[] petByteArray = GetBytes ((string)petApi.Configuration.ApiClient.Serialize (p)); petApi.AddPetUsingByteArray (petByteArray); - } + }*/ /// /// Test UpdatePetWithForm @@ -225,7 +234,7 @@ namespace SwaggerClientTest.TestPet public void TestUpdatePetWithForm () { PetApi petApi = new PetApi (); - petApi.UpdatePetWithForm (petId.ToString(), "new form name", "pending"); + petApi.UpdatePetWithForm (petId, "new form name", "pending"); Pet response = petApi.GetPetById (petId); Assert.IsInstanceOf (response, "Response is a Pet"); @@ -239,7 +248,7 @@ namespace SwaggerClientTest.TestPet Assert.AreEqual (56, response.Category.Id); // test optional parameter - petApi.UpdatePetWithForm (petId.ToString(), "new form name2"); + petApi.UpdatePetWithForm (petId, "new form name2"); Pet response2 = petApi.GetPetById (petId); Assert.AreEqual ("new form name2", response2.Name); } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt index 323cad108c6b..0991d15f1187 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt +++ b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt @@ -1,9 +1,9 @@ /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png +/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll +/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll +/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll /Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll -/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll