forked from loafle/openapi-generator-original
add new sample files
This commit is contained in:
parent
d64af1b836
commit
2111e9ef8d
@ -0,0 +1,91 @@
|
||||
# IO.Swagger.Api.FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters
|
||||
|
||||
|
||||
# **TestEndpointParameters**
|
||||
> void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class TestEndpointParametersExample
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var number = 3.4; // double? | None
|
||||
var _double = 1.2; // double? | None
|
||||
var _string = _string_example; // string | None
|
||||
var _byte = B; // byte[] | None
|
||||
var integer = 56; // int? | None (optional)
|
||||
var int32 = 56; // int? | None (optional)
|
||||
var int64 = 789; // long? | None (optional)
|
||||
var _float = 3.4; // float? | None (optional)
|
||||
var binary = B; // byte[] | None (optional)
|
||||
var date = 2013-10-20; // DateTime? | None (optional)
|
||||
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional)
|
||||
var password = password_example; // string | None (optional)
|
||||
|
||||
try
|
||||
{
|
||||
// Fake endpoint for testing various parameters
|
||||
apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **double?**| None |
|
||||
**_double** | **double?**| None |
|
||||
**_string** | **string**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **int?**| None | [optional]
|
||||
**int32** | **int?**| None | [optional]
|
||||
**int64** | **long?**| None | [optional]
|
||||
**_float** | **float?**| None | [optional]
|
||||
**binary** | **byte[]**| None | [optional]
|
||||
**date** | **DateTime?**| None | [optional]
|
||||
**dateTime** | **DateTime?**| None | [optional]
|
||||
**password** | **string**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
[[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)
|
||||
|
@ -0,0 +1,418 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using RestSharp;
|
||||
using IO.Swagger.Client;
|
||||
|
||||
namespace IO.Swagger.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IFakeApi
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns></returns>
|
||||
void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Fake endpoint for testing various parameters
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public class FakeApi : IFakeApi
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FakeApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public FakeApi(String basePath)
|
||||
{
|
||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FakeApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public FakeApi(Configuration configuration = null)
|
||||
{
|
||||
if (configuration == null) // use the default one in Configuration
|
||||
this.Configuration = Configuration.Default;
|
||||
else
|
||||
this.Configuration = configuration;
|
||||
|
||||
// ensure API client has configuration ready
|
||||
if (Configuration.ApiClient.Configuration == null)
|
||||
{
|
||||
this.Configuration.ApiClient.Configuration = this.Configuration;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public String GetBasePath()
|
||||
{
|
||||
return this.Configuration.ApiClient.RestClient.BaseUrl.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
[Obsolete("SetBasePath is deprecated, please do 'Configuraiton.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
|
||||
public void SetBasePath(String basePath)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Configuration Configuration {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default header.
|
||||
/// </summary>
|
||||
/// <returns>Dictionary of HTTP header</returns>
|
||||
[Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
|
||||
public Dictionary<String, String> DefaultHeader()
|
||||
{
|
||||
return this.Configuration.DefaultHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add default header.
|
||||
/// </summary>
|
||||
/// <param name="key">Header field name.</param>
|
||||
/// <param name="value">Header field value.</param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
|
||||
public void AddDefaultHeader(string key, string value)
|
||||
{
|
||||
this.Configuration.AddDefaultHeader(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns></returns>
|
||||
public void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
TestEndpointParametersWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_string' is set
|
||||
if (_string == null)
|
||||
throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_byte' is set
|
||||
if (_byte == null)
|
||||
throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter
|
||||
if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter
|
||||
if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter
|
||||
if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter
|
||||
if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter
|
||||
if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter
|
||||
if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter
|
||||
if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter
|
||||
if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter
|
||||
if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter
|
||||
if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter
|
||||
if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
await TestEndpointParametersAsyncWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="number">None</param>
|
||||
/// <param name="_double">None</param>
|
||||
/// <param name="_string">None</param>
|
||||
/// <param name="_byte">None</param>
|
||||
/// <param name="integer">None (optional)</param>
|
||||
/// <param name="int32">None (optional)</param>
|
||||
/// <param name="int64">None (optional)</param>
|
||||
/// <param name="_float">None (optional)</param>
|
||||
/// <param name="binary">None (optional)</param>
|
||||
/// <param name="date">None (optional)</param>
|
||||
/// <param name="dateTime">None (optional)</param>
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_string' is set
|
||||
if (_string == null)
|
||||
throw new ApiException(400, "Missing required parameter '_string' when calling FakeApi->TestEndpointParameters");
|
||||
// verify the required parameter '_byte' is set
|
||||
if (_byte == null)
|
||||
throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/xml",
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter
|
||||
if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter
|
||||
if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter
|
||||
if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter
|
||||
if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter
|
||||
if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter
|
||||
if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter
|
||||
if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter
|
||||
if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter
|
||||
if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter
|
||||
if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter
|
||||
if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (localVarStatusCode >= 400)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
||||
else if (localVarStatusCode == 0)
|
||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
75
samples/client/petstore/java/default/docs/FakeApi.md
Normal file
75
samples/client/petstore/java/default/docs/FakeApi.md
Normal file
@ -0,0 +1,75 @@
|
||||
# FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters
|
||||
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password)
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
Fake endpoint for testing various parameters
|
||||
|
||||
### Example
|
||||
```java
|
||||
// Import classes:
|
||||
//import io.swagger.client.ApiException;
|
||||
//import io.swagger.client.api.FakeApi;
|
||||
|
||||
|
||||
FakeApi apiInstance = new FakeApi();
|
||||
BigDecimal number = new BigDecimal(); // BigDecimal | None
|
||||
Double _double = 3.4D; // Double | None
|
||||
String string = "string_example"; // String | None
|
||||
byte[] _byte = B; // byte[] | None
|
||||
Integer integer = 56; // Integer | None
|
||||
Integer int32 = 56; // Integer | None
|
||||
Long int64 = 789L; // Long | None
|
||||
Float _float = 3.4F; // Float | None
|
||||
byte[] binary = B; // byte[] | None
|
||||
Date date = new Date(); // Date | None
|
||||
Date dateTime = new Date(); // Date | None
|
||||
String password = "password_example"; // String | None
|
||||
try {
|
||||
apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeApi#testEndpointParameters");
|
||||
e.printStackTrace();
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **BigDecimal**| None |
|
||||
**_double** | **Double**| None |
|
||||
**string** | **String**| None |
|
||||
**_byte** | **byte[]**| None |
|
||||
**integer** | **Integer**| None | [optional]
|
||||
**int32** | **Integer**| None | [optional]
|
||||
**int64** | **Long**| None | [optional]
|
||||
**_float** | **Float**| None | [optional]
|
||||
**binary** | **byte[]**| None | [optional]
|
||||
**date** | **Date**| None | [optional]
|
||||
**dateTime** | **Date**| None | [optional]
|
||||
**password** | **String**| None | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
@ -0,0 +1,128 @@
|
||||
package io.swagger.client.api;
|
||||
|
||||
import com.sun.jersey.api.client.GenericType;
|
||||
|
||||
import io.swagger.client.ApiException;
|
||||
import io.swagger.client.ApiClient;
|
||||
import io.swagger.client.Configuration;
|
||||
import io.swagger.client.Pair;
|
||||
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class FakeApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public FakeApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public FakeApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters
|
||||
* Fake endpoint for testing various parameters
|
||||
* @param number None (required)
|
||||
* @param _double None (required)
|
||||
* @param string None (required)
|
||||
* @param _byte None (required)
|
||||
* @param integer None (optional)
|
||||
* @param int32 None (optional)
|
||||
* @param int64 None (optional)
|
||||
* @param _float None (optional)
|
||||
* @param binary None (optional)
|
||||
* @param date None (optional)
|
||||
* @param dateTime None (optional)
|
||||
* @param password None (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password) throws ApiException {
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null) {
|
||||
throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
// verify the required parameter 'string' is set
|
||||
if (string == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'string' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
// verify the required parameter '_byte' is set
|
||||
if (_byte == null) {
|
||||
throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters");
|
||||
}
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake".replaceAll("\\{format\\}","json");
|
||||
|
||||
// query params
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
|
||||
|
||||
if (integer != null)
|
||||
localVarFormParams.put("integer", integer);
|
||||
if (int32 != null)
|
||||
localVarFormParams.put("int32", int32);
|
||||
if (int64 != null)
|
||||
localVarFormParams.put("int64", int64);
|
||||
if (number != null)
|
||||
localVarFormParams.put("number", number);
|
||||
if (_float != null)
|
||||
localVarFormParams.put("float", _float);
|
||||
if (_double != null)
|
||||
localVarFormParams.put("double", _double);
|
||||
if (string != null)
|
||||
localVarFormParams.put("string", string);
|
||||
if (_byte != null)
|
||||
localVarFormParams.put("byte", _byte);
|
||||
if (binary != null)
|
||||
localVarFormParams.put("binary", binary);
|
||||
if (date != null)
|
||||
localVarFormParams.put("date", date);
|
||||
if (dateTime != null)
|
||||
localVarFormParams.put("dateTime", dateTime);
|
||||
if (password != null)
|
||||
localVarFormParams.put("password", password);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
|
||||
apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
|
||||
}
|
||||
}
|
8
samples/client/petstore/ruby/docs/200Response.md
Normal file
8
samples/client/petstore/ruby/docs/200Response.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Petstore::200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **Integer** | | [optional]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user