forked from loafle/openapi-generator-original
Inline allOf parameters are always not required (#14278)
* fixed the issue * added comment
This commit is contained in:
parent
031115356d
commit
927bfa481f
@ -6722,6 +6722,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// Set 'required' flag defined in the schema element
|
||||
if (!codegenParameter.required && schema.getRequired() != null) {
|
||||
codegenParameter.required = schema.getRequired().contains(entry.getKey());
|
||||
} else if (!codegenParameter.required) {
|
||||
// Set 'required' flag for properties declared inside the allOf
|
||||
codegenParameter.required = allRequired.stream().anyMatch(r -> r.equals(codegenParameter.paramName));
|
||||
}
|
||||
|
||||
parameters.add(codegenParameter);
|
||||
|
@ -1117,6 +1117,23 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ArrayOfEnums'
|
||||
/country:
|
||||
post:
|
||||
operationId: getCountry
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
allOf:
|
||||
- required:
|
||||
- country
|
||||
type: object
|
||||
properties:
|
||||
country:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
servers:
|
||||
- url: 'http://{server}.swagger.io:{port}/v2'
|
||||
description: petstore server
|
||||
|
@ -105,6 +105,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -60,6 +60,41 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<FooGetDefaultResponse?></returns>
|
||||
Task<FooGetDefaultResponse?> FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,5 +300,159 @@ namespace Org.OpenAPITools.Api
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result.Content == null)
|
||||
throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent);
|
||||
|
||||
return result.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? result = null;
|
||||
try
|
||||
{
|
||||
result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return result != null && result.IsSuccessStatusCode
|
||||
? result.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
/// <param name="country"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual string OnGetCountry(string country)
|
||||
{
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (country == null)
|
||||
throw new ArgumentNullException(nameof(country));
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return country;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponse"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void AfterGetCountry(ApiResponse<object?> apiResponse, string country)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="exception"></param>
|
||||
/// <param name="pathFormat"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void OnErrorGetCountry(Exception exception, string pathFormat, string path, string country)
|
||||
{
|
||||
Logger.LogError(exception, "An error occurred while sending the request to the server.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilder = new UriBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
country = OnGetCountry(country);
|
||||
|
||||
using (HttpRequestMessage request = new HttpRequestMessage())
|
||||
{
|
||||
uriBuilder.Host = HttpClient.BaseAddress!.Host;
|
||||
uriBuilder.Port = HttpClient.BaseAddress!.Port;
|
||||
uriBuilder.Scheme = ClientUtils.SCHEME;
|
||||
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country";
|
||||
|
||||
MultipartContent multipartContent = new MultipartContent();
|
||||
|
||||
request.Content = multipartContent;
|
||||
|
||||
List<KeyValuePair<string?, string?>> formParams = new List<KeyValuePair<string?, string?>>();
|
||||
|
||||
multipartContent.Add(new FormUrlEncodedContent(formParams));
|
||||
|
||||
formParams.Add(new KeyValuePair<string?, string?>("country", ClientUtils.ParameterToString(country)));
|
||||
|
||||
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
string[] contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
string? contentType = ClientUtils.SelectHeaderContentType(contentTypes);
|
||||
|
||||
if (contentType != null)
|
||||
request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
DateTime requestedAt = DateTime.UtcNow;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path));
|
||||
|
||||
string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponse.Content = JsonSerializer.Deserialize<object>(apiResponse.RawContent, _jsonSerializerOptions);
|
||||
AfterGetCountry(apiResponse, country);
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
OnErrorGetCountry(e, "/country", uriBuilder.Path, country);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -48,6 +48,30 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<FooGetDefaultResponse></returns>
|
||||
Task<FooGetDefaultResponse> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object>></returns>
|
||||
Task<ApiResponse<object>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,5 +277,159 @@ namespace Org.OpenAPITools.Api
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object> result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result.Content == null)
|
||||
throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent);
|
||||
|
||||
return result.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object> result = null;
|
||||
try
|
||||
{
|
||||
result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return result != null && result.IsSuccessStatusCode
|
||||
? result.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
/// <param name="country"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual string OnGetCountry(string country)
|
||||
{
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (country == null)
|
||||
throw new ArgumentNullException(nameof(country));
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return country;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponse"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void AfterGetCountry(ApiResponse<object> apiResponse, string country)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="exception"></param>
|
||||
/// <param name="pathFormat"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void OnErrorGetCountry(Exception exception, string pathFormat, string path, string country)
|
||||
{
|
||||
Logger.LogError(exception, "An error occurred while sending the request to the server.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilder = new UriBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
country = OnGetCountry(country);
|
||||
|
||||
using (HttpRequestMessage request = new HttpRequestMessage())
|
||||
{
|
||||
uriBuilder.Host = HttpClient.BaseAddress.Host;
|
||||
uriBuilder.Port = HttpClient.BaseAddress.Port;
|
||||
uriBuilder.Scheme = ClientUtils.SCHEME;
|
||||
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country";
|
||||
|
||||
MultipartContent multipartContent = new MultipartContent();
|
||||
|
||||
request.Content = multipartContent;
|
||||
|
||||
List<KeyValuePair<string, string>> formParams = new List<KeyValuePair<string, string>>();
|
||||
|
||||
multipartContent.Add(new FormUrlEncodedContent(formParams));
|
||||
|
||||
formParams.Add(new KeyValuePair<string, string>("country", ClientUtils.ParameterToString(country)));
|
||||
|
||||
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
string[] contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
string contentType = ClientUtils.SelectHeaderContentType(contentTypes);
|
||||
|
||||
if (contentType != null)
|
||||
request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
DateTime requestedAt = DateTime.UtcNow;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path));
|
||||
|
||||
string responseContent = await responseMessage.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object> apiResponse = new ApiResponse<object>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponse.Content = JsonSerializer.Deserialize<object>(apiResponse.RawContent, _jsonSerializerOptions);
|
||||
AfterGetCountry(apiResponse, country);
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
OnErrorGetCountry(e, "/country", uriBuilder.Path, country);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
|
||||
|
||||
|
@ -48,6 +48,30 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<FooGetDefaultResponse></returns>
|
||||
Task<FooGetDefaultResponse> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object>></returns>
|
||||
Task<ApiResponse<object>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,5 +277,159 @@ namespace Org.OpenAPITools.Api
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object> result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (result.Content == null)
|
||||
throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent);
|
||||
|
||||
return result.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object> result = null;
|
||||
try
|
||||
{
|
||||
result = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return result != null && result.IsSuccessStatusCode
|
||||
? result.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
/// <param name="country"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual string OnGetCountry(string country)
|
||||
{
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
if (country == null)
|
||||
throw new ArgumentNullException(nameof(country));
|
||||
|
||||
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return country;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponse"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void AfterGetCountry(ApiResponse<object> apiResponse, string country)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="exception"></param>
|
||||
/// <param name="pathFormat"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void OnErrorGetCountry(Exception exception, string pathFormat, string path, string country)
|
||||
{
|
||||
Logger.LogError(exception, "An error occurred while sending the request to the server.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilder = new UriBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
country = OnGetCountry(country);
|
||||
|
||||
using (HttpRequestMessage request = new HttpRequestMessage())
|
||||
{
|
||||
uriBuilder.Host = HttpClient.BaseAddress.Host;
|
||||
uriBuilder.Port = HttpClient.BaseAddress.Port;
|
||||
uriBuilder.Scheme = ClientUtils.SCHEME;
|
||||
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/country";
|
||||
|
||||
MultipartContent multipartContent = new MultipartContent();
|
||||
|
||||
request.Content = multipartContent;
|
||||
|
||||
List<KeyValuePair<string, string>> formParams = new List<KeyValuePair<string, string>>();
|
||||
|
||||
multipartContent.Add(new FormUrlEncodedContent(formParams));
|
||||
|
||||
formParams.Add(new KeyValuePair<string, string>("country", ClientUtils.ParameterToString(country)));
|
||||
|
||||
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
string[] contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
string contentType = ClientUtils.SelectHeaderContentType(contentTypes);
|
||||
|
||||
if (contentType != null)
|
||||
request.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
|
||||
|
||||
request.Method = new HttpMethod("POST");
|
||||
|
||||
DateTime requestedAt = DateTime.UtcNow;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
OnApiResponded(new ApiResponseEventArgs(requestedAt, DateTime.UtcNow, responseMessage.StatusCode, "/country", uriBuilder.Path));
|
||||
|
||||
string responseContent = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object> apiResponse = new ApiResponse<object>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponse.Content = JsonSerializer.Deserialize<object>(apiResponse.RawContent, _jsonSerializerOptions);
|
||||
AfterGetCountry(apiResponse, country);
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
OnErrorGetCountry(e, "/country", uriBuilder.Path, country);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,6 +130,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -92,3 +93,90 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
|
||||
HttpClient httpClient = new HttpClient();
|
||||
HttpClientHandler httpClientHandler = new HttpClientHandler();
|
||||
var apiInstance = new DefaultApi(httpClient, config, httpClientHandler);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -43,6 +43,24 @@ namespace Org.OpenAPITools.Api
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -73,6 +91,29 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -387,5 +428,118 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null) throw _exception;
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task GetCountryAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></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>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
|
||||
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);
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null) throw _exception;
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -105,6 +105,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
|
||||
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
|
@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| Method | HTTP request | Description |
|
||||
|--------|--------------|-------------|
|
||||
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
|
||||
<a name="fooget"></a>
|
||||
# **FooGet**
|
||||
@ -88,3 +89,86 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
<a name="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class GetCountryExample
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
Configuration config = new Configuration();
|
||||
config.BasePath = "http://petstore.swagger.io:80/v2";
|
||||
var apiInstance = new DefaultApi(config);
|
||||
var country = "country_example"; // string |
|
||||
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountry(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Using the GetCountryWithHttpInfo variant
|
||||
This returns an ApiResponse object which contains the response data, status code and headers.
|
||||
|
||||
```csharp
|
||||
try
|
||||
{
|
||||
apiInstance.GetCountryWithHttpInfo(country);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
|
||||
Debug.Print("Status Code: " + e.ErrorCode);
|
||||
Debug.Print(e.StackTrace);
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------|------|-------------|-------|
|
||||
| **country** | **string** | | |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | OK | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -45,6 +45,26 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of FooGetDefaultResponse</returns>
|
||||
ApiResponse<FooGetDefaultResponse> FooGetWithHttpInfo(int operationIndex = 0);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
void GetCountry(string country, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
@ -77,6 +97,31 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (FooGetDefaultResponse)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<FooGetDefaultResponse>> FooGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@ -323,5 +368,147 @@ namespace Org.OpenAPITools.Api
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns></returns>
|
||||
public void GetCountry(string country, int operationIndex = 0)
|
||||
{
|
||||
GetCountryWithHttpInfo(country);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> GetCountryWithHttpInfo(string country, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<Object>("/country", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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 GetCountryAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
await GetCountryWithHttpInfoAsync(country, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <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>> GetCountryWithHttpInfoAsync(string country, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'country' is set
|
||||
if (country == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'country' when calling DefaultApi->GetCountry");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
localVarRequestOptions.FormParameters.Add("country", Org.OpenAPITools.Client.ClientUtils.ParameterToString(country)); // form parameter
|
||||
|
||||
localVarRequestOptions.Operation = "DefaultApi.GetCountry";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/country", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("GetCountry", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user