mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 21:47:13 +00:00
update c# samples
This commit is contained in:
@@ -72,6 +72,29 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> TestBodyApplicationOctetstreamBinaryWithHttpInfo(System.IO.Stream? body = default(System.IO.Stream?), int operationIndex = 0);
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
string TestBodyMultipartFormdataArrayOfBinary(List<System.IO.Stream> files, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(List<System.IO.Stream> files, int operationIndex = 0);
|
||||
/// <summary>
|
||||
/// Test free form object
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -221,6 +244,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> TestBodyApplicationOctetstreamBinaryWithHttpInfoAsync(System.IO.Stream? body = default(System.IO.Stream?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
System.Threading.Tasks.Task<string> TestBodyMultipartFormdataArrayOfBinaryAsync(List<System.IO.Stream> files, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test array of binary in multipart mime
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> TestBodyMultipartFormdataArrayOfBinaryWithHttpInfoAsync(List<System.IO.Stream> files, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
/// Test free form object
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -700,6 +748,158 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
public string TestBodyMultipartFormdataArrayOfBinary(List<System.IO.Stream> files, int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<string> TestBodyMultipartFormdataArrayOfBinaryWithHttpInfo(List<System.IO.Stream> files, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'files' is set
|
||||
if (files == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'files' when calling BodyApi->TestBodyMultipartFormdataArrayOfBinary");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"multipart/form-data"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
localVarRequestOptions.FileParameters.Add("files", file);
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "BodyApi.TestBodyMultipartFormdataArrayOfBinary";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<string>("/body/application/octetstream/array_of_binary", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestBodyMultipartFormdataArrayOfBinary", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
public async System.Threading.Tasks.Task<string> TestBodyMultipartFormdataArrayOfBinaryAsync(List<System.IO.Stream> files, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await TestBodyMultipartFormdataArrayOfBinaryWithHttpInfoAsync(files, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test array of binary in multipart mime Test array of binary in multipart mime
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="files"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> TestBodyMultipartFormdataArrayOfBinaryWithHttpInfoAsync(List<System.IO.Stream> files, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'files' is set
|
||||
if (files == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'files' when calling BodyApi->TestBodyMultipartFormdataArrayOfBinary");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"multipart/form-data"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
localVarRequestOptions.FileParameters.Add("files", file);
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "BodyApi.TestBodyMultipartFormdataArrayOfBinary";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<string>("/body/application/octetstream/array_of_binary", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestBodyMultipartFormdataArrayOfBinary", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test free form object Test free form object
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user