[Inline model resolver] various improvements (#12293)

* better handling of requestbody in the inline resolver

* remove commented code

* better request body naming

* fix unique naming

* minor code format change

* removed additional underscore from names, fix test

* more fixes, update tests

* fix all tests

* undo changes to default codegen

* update samples

* update python tests

* add new files

* update samples
This commit is contained in:
William Cheng
2022-05-10 17:13:57 +08:00
committed by GitHub
parent 4d0da694ba
commit ad3b5f7045
186 changed files with 9764 additions and 8111 deletions

View File

@@ -2,12 +2,12 @@
Org.OpenAPITools.sln
README.md
appveyor.yml
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/MultipartApi.md
docs/MultipartMixedMarker.md
docs/MultipartArrayRequest.md
docs/MultipartMixedRequest.md
docs/MultipartMixedRequestMarker.md
docs/MultipartMixedStatus.md
docs/MultipartSingleRequest.md
git_push.sh
src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj
src/Org.OpenAPITools/Api/MultipartApi.cs
@@ -28,9 +28,9 @@ src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
src/Org.OpenAPITools/Client/RequestOptions.cs
src/Org.OpenAPITools/Client/RetryConfiguration.cs
src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
src/Org.OpenAPITools/Model/InlineObject.cs
src/Org.OpenAPITools/Model/InlineObject1.cs
src/Org.OpenAPITools/Model/InlineObject2.cs
src/Org.OpenAPITools/Model/MultipartMixedMarker.cs
src/Org.OpenAPITools/Model/MultipartArrayRequest.cs
src/Org.OpenAPITools/Model/MultipartMixedRequest.cs
src/Org.OpenAPITools/Model/MultipartMixedRequestMarker.cs
src/Org.OpenAPITools/Model/MultipartMixedStatus.cs
src/Org.OpenAPITools/Model/MultipartSingleRequest.cs
src/Org.OpenAPITools/Org.OpenAPITools.csproj

View File

@@ -109,11 +109,11 @@ Class | Method | HTTP request | Description
<a name="documentation-for-models"></a>
## Documentation for Models
- [Model.InlineObject](docs/InlineObject.md)
- [Model.InlineObject1](docs/InlineObject1.md)
- [Model.InlineObject2](docs/InlineObject2.md)
- [Model.MultipartMixedMarker](docs/MultipartMixedMarker.md)
- [Model.MultipartArrayRequest](docs/MultipartArrayRequest.md)
- [Model.MultipartMixedRequest](docs/MultipartMixedRequest.md)
- [Model.MultipartMixedRequestMarker](docs/MultipartMixedRequestMarker.md)
- [Model.MultipartMixedStatus](docs/MultipartMixedStatus.md)
- [Model.MultipartSingleRequest](docs/MultipartSingleRequest.md)
<a name="documentation-for-authorization"></a>

View File

@@ -80,7 +80,7 @@ No authorization required
<a name="multipartmixed"></a>
# **MultipartMixed**
> void MultipartMixed (MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = null)
> void MultipartMixed (MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = null)
@@ -105,7 +105,7 @@ namespace Example
var apiInstance = new MultipartApi(config);
var status = (MultipartMixedStatus) "ALLOWED"; // MultipartMixedStatus |
var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | a file
var marker = new MultipartMixedMarker(); // MultipartMixedMarker | (optional)
var marker = new MultipartMixedRequestMarker(); // MultipartMixedRequestMarker | (optional)
try
{
@@ -128,7 +128,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | **MultipartMixedStatus**| |
**file** | **System.IO.Stream****System.IO.Stream**| a file |
**marker** | [**MultipartMixedMarker**](MultipartMixedMarker.md)| | [optional]
**marker** | [**MultipartMixedRequestMarker**](MultipartMixedRequestMarker.md)| | [optional]
### Return type

View File

@@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.MultipartArrayRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Files** | **List&lt;System.IO.Stream&gt;** | Many files | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.MultipartMixedRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Status** | **MultipartMixedStatus** | |
**Marker** | [**MultipartMixedRequestMarker**](MultipartMixedRequestMarker.md) | | [optional]
**File** | **System.IO.Stream** | a file |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# Org.OpenAPITools.Model.MultipartMixedRequestMarker
additional object
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.MultipartSingleRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**File** | **System.IO.Stream** | One file | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,70 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing MultipartArrayRequest
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class MultipartArrayRequestTests : IDisposable
{
// TODO uncomment below to declare an instance variable for MultipartArrayRequest
//private MultipartArrayRequest instance;
public MultipartArrayRequestTests()
{
// TODO uncomment below to create an instance of MultipartArrayRequest
//instance = new MultipartArrayRequest();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of MultipartArrayRequest
/// </summary>
[Fact]
public void MultipartArrayRequestInstanceTest()
{
// TODO uncomment below to test "IsType" MultipartArrayRequest
//Assert.IsType<MultipartArrayRequest>(instance);
}
/// <summary>
/// Test the property 'Files'
/// </summary>
[Fact]
public void FilesTest()
{
// TODO unit test for the property 'Files'
}
}
}

View File

@@ -0,0 +1,70 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing MultipartMixedRequestMarker
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class MultipartMixedRequestMarkerTests : IDisposable
{
// TODO uncomment below to declare an instance variable for MultipartMixedRequestMarker
//private MultipartMixedRequestMarker instance;
public MultipartMixedRequestMarkerTests()
{
// TODO uncomment below to create an instance of MultipartMixedRequestMarker
//instance = new MultipartMixedRequestMarker();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of MultipartMixedRequestMarker
/// </summary>
[Fact]
public void MultipartMixedRequestMarkerInstanceTest()
{
// TODO uncomment below to test "IsType" MultipartMixedRequestMarker
//Assert.IsType<MultipartMixedRequestMarker>(instance);
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'
}
}
}

View File

@@ -0,0 +1,86 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing MultipartMixedRequest
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class MultipartMixedRequestTests : IDisposable
{
// TODO uncomment below to declare an instance variable for MultipartMixedRequest
//private MultipartMixedRequest instance;
public MultipartMixedRequestTests()
{
// TODO uncomment below to create an instance of MultipartMixedRequest
//instance = new MultipartMixedRequest();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of MultipartMixedRequest
/// </summary>
[Fact]
public void MultipartMixedRequestInstanceTest()
{
// TODO uncomment below to test "IsType" MultipartMixedRequest
//Assert.IsType<MultipartMixedRequest>(instance);
}
/// <summary>
/// Test the property 'Status'
/// </summary>
[Fact]
public void StatusTest()
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Marker'
/// </summary>
[Fact]
public void MarkerTest()
{
// TODO unit test for the property 'Marker'
}
/// <summary>
/// Test the property 'File'
/// </summary>
[Fact]
public void FileTest()
{
// TODO unit test for the property 'File'
}
}
}

View File

@@ -0,0 +1,70 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing MultipartSingleRequest
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class MultipartSingleRequestTests : IDisposable
{
// TODO uncomment below to declare an instance variable for MultipartSingleRequest
//private MultipartSingleRequest instance;
public MultipartSingleRequestTests()
{
// TODO uncomment below to create an instance of MultipartSingleRequest
//instance = new MultipartSingleRequest();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of MultipartSingleRequest
/// </summary>
[Fact]
public void MultipartSingleRequestInstanceTest()
{
// TODO uncomment below to test "IsType" MultipartSingleRequest
//Assert.IsType<MultipartSingleRequest>(instance);
}
/// <summary>
/// Test the property 'File'
/// </summary>
[Fact]
public void FileTest()
{
// TODO unit test for the property 'File'
}
}
}

View File

@@ -61,7 +61,7 @@ namespace Org.OpenAPITools.Api
/// <param name="marker"> (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns></returns>
void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0);
void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0);
/// <summary>
///
@@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api
/// <param name="marker"> (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0);
ApiResponse<Object> MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0);
/// <summary>
///
/// </summary>
@@ -146,7 +146,7 @@ namespace Org.OpenAPITools.Api
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@@ -161,7 +161,7 @@ namespace Org.OpenAPITools.Api
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<Object>> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
/// </summary>
@@ -458,7 +458,7 @@ namespace Org.OpenAPITools.Api
/// <param name="marker"> (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns></returns>
public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0)
public void MultipartMixed(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0)
{
MultipartMixedWithHttpInfo(status, file, marker);
}
@@ -472,7 +472,7 @@ namespace Org.OpenAPITools.Api
/// <param name="marker"> (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of Object(void)</returns>
public Org.OpenAPITools.Client.ApiResponse<Object> MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<Object> MultipartMixedWithHttpInfo(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0)
{
// verify the required parameter 'file' is set
if (file == null)
@@ -537,7 +537,7 @@ namespace Org.OpenAPITools.Api
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task MultipartMixedAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
await MultipartMixedWithHttpInfoAsync(status, file, marker, operationIndex, cancellationToken).ConfigureAwait(false);
}
@@ -552,7 +552,7 @@ namespace Org.OpenAPITools.Api
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedMarker marker = default(MultipartMixedMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> MultipartMixedWithHttpInfoAsync(MultipartMixedStatus status, System.IO.Stream file, MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
// verify the required parameter 'file' is set
if (file == null)

View File

@@ -0,0 +1,121 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// MultipartArrayRequest
/// </summary>
[DataContract(Name = "multipartArray_request")]
public partial class MultipartArrayRequest : IEquatable<MultipartArrayRequest>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MultipartArrayRequest" /> class.
/// </summary>
/// <param name="files">Many files.</param>
public MultipartArrayRequest(List<System.IO.Stream> files = default(List<System.IO.Stream>))
{
this.Files = files;
}
/// <summary>
/// Many files
/// </summary>
/// <value>Many files</value>
[DataMember(Name = "files", EmitDefaultValue = false)]
public List<System.IO.Stream> Files { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class MultipartArrayRequest {\n");
sb.Append(" Files: ").Append(Files).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartArrayRequest).AreEqual;
}
/// <summary>
/// Returns true if MultipartArrayRequest instances are equal
/// </summary>
/// <param name="input">Instance of MultipartArrayRequest to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(MultipartArrayRequest input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Files != null)
{
hashCode = (hashCode * 59) + this.Files.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@@ -0,0 +1,154 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// MultipartMixedRequest
/// </summary>
[DataContract(Name = "multipartMixed_request")]
public partial class MultipartMixedRequest : IEquatable<MultipartMixedRequest>, IValidatableObject
{
/// <summary>
/// Gets or Sets Status
/// </summary>
[DataMember(Name = "status", IsRequired = true, EmitDefaultValue = false)]
public MultipartMixedStatus Status { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="MultipartMixedRequest" /> class.
/// </summary>
[JsonConstructorAttribute]
protected MultipartMixedRequest() { }
/// <summary>
/// Initializes a new instance of the <see cref="MultipartMixedRequest" /> class.
/// </summary>
/// <param name="status">status (required).</param>
/// <param name="marker">marker.</param>
/// <param name="file">a file (required).</param>
public MultipartMixedRequest(MultipartMixedStatus status = default(MultipartMixedStatus), MultipartMixedRequestMarker marker = default(MultipartMixedRequestMarker), System.IO.Stream file = default(System.IO.Stream))
{
this.Status = status;
// to ensure "file" is required (not null)
if (file == null)
{
throw new ArgumentNullException("file is a required property for MultipartMixedRequest and cannot be null");
}
this.File = file;
this.Marker = marker;
}
/// <summary>
/// Gets or Sets Marker
/// </summary>
[DataMember(Name = "marker", EmitDefaultValue = false)]
public MultipartMixedRequestMarker Marker { get; set; }
/// <summary>
/// a file
/// </summary>
/// <value>a file</value>
[DataMember(Name = "file", IsRequired = true, EmitDefaultValue = false)]
public System.IO.Stream File { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class MultipartMixedRequest {\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" Marker: ").Append(Marker).Append("\n");
sb.Append(" File: ").Append(File).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartMixedRequest).AreEqual;
}
/// <summary>
/// Returns true if MultipartMixedRequest instances are equal
/// </summary>
/// <param name="input">Instance of MultipartMixedRequest to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(MultipartMixedRequest input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
hashCode = (hashCode * 59) + this.Status.GetHashCode();
if (this.Marker != null)
{
hashCode = (hashCode * 59) + this.Marker.GetHashCode();
}
if (this.File != null)
{
hashCode = (hashCode * 59) + this.File.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@@ -0,0 +1,120 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// additional object
/// </summary>
[DataContract(Name = "multipartMixed_request_marker")]
public partial class MultipartMixedRequestMarker : IEquatable<MultipartMixedRequestMarker>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MultipartMixedRequestMarker" /> class.
/// </summary>
/// <param name="name">name.</param>
public MultipartMixedRequestMarker(string name = default(string))
{
this.Name = name;
}
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class MultipartMixedRequestMarker {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartMixedRequestMarker).AreEqual;
}
/// <summary>
/// Returns true if MultipartMixedRequestMarker instances are equal
/// </summary>
/// <param name="input">Instance of MultipartMixedRequestMarker to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(MultipartMixedRequestMarker input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@@ -0,0 +1,121 @@
/*
* MultipartFile test
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// MultipartSingleRequest
/// </summary>
[DataContract(Name = "multipartSingle_request")]
public partial class MultipartSingleRequest : IEquatable<MultipartSingleRequest>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MultipartSingleRequest" /> class.
/// </summary>
/// <param name="file">One file.</param>
public MultipartSingleRequest(System.IO.Stream file = default(System.IO.Stream))
{
this.File = file;
}
/// <summary>
/// One file
/// </summary>
/// <value>One file</value>
[DataMember(Name = "file", EmitDefaultValue = false)]
public System.IO.Stream File { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class MultipartSingleRequest {\n");
sb.Append(" File: ").Append(File).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as MultipartSingleRequest).AreEqual;
}
/// <summary>
/// Returns true if MultipartSingleRequest instances are equal
/// </summary>
/// <param name="input">Instance of MultipartSingleRequest to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(MultipartSingleRequest input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.File != null)
{
hashCode = (hashCode * 59) + this.File.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}