[csharp-netcore] add tests for uuid string with pattern (#14411)

* add tests for uuid with pattern in csharp clients

* update samples

* update samples

* update
This commit is contained in:
William Cheng 2023-02-08 20:54:56 +08:00 committed by GitHub
parent 98333492cf
commit 011982ab9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 578 additions and 155 deletions

View File

@ -848,6 +848,14 @@ paths:
- fake
description: Test serialization of outer string types
operationId: fakeOuterStringSerialize
parameters:
- name: required_string_uuid
in: query
description: Required UUID String
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Output string
@ -1621,6 +1629,10 @@ components:
MixedPropertiesAndAdditionalPropertiesClass:
type: object
properties:
uuid_with_pattern:
type: string
format: uuid
pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
uuid:
type: string
format: uuid

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,11 +35,17 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this._UuidWithPattern = uuidWithPattern;
if (this.UuidWithPattern != null)
{
this._flagUuidWithPattern = true;
}
this._Uuid = uuid;
if (this.Uuid != null)
{
@ -58,6 +64,30 @@ namespace Org.OpenAPITools.Model
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern
{
get{ return _UuidWithPattern;}
set
{
_UuidWithPattern = value;
_flagUuidWithPattern = true;
}
}
private Guid _UuidWithPattern;
private bool _flagUuidWithPattern;
/// <summary>
/// Returns false as UuidWithPattern should not be serialized given that it's read-only.
/// </summary>
/// <returns>false (boolean)</returns>
public bool ShouldSerializeUuidWithPattern()
{
return _flagUuidWithPattern;
}
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -144,6 +174,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -190,6 +221,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -217,6 +252,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string? body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string? body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string? | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string?** | Input string as post body | [optional] |
### Return type

View File

@ -7,6 +7,7 @@ Name | Type | Description | Notes
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]
**Uuid** | **Guid** | | [optional]
**UuidWithPattern** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api
[Fact (Skip = "not implemented")]
public async Task FakeOuterStringSerializeAsyncTest()
{
Guid requiredStringUuid = default;
string? body = default;
var response = await _instance.FakeOuterStringSerializeAsync(body);
var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body);
Assert.IsType<string>(response);
}

View File

@ -173,10 +173,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task&lt;ApiResponse&lt;string?&gt;&gt;</returns>
Task<ApiResponse<string?>> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<ApiResponse<string?>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
///
@ -185,10 +186,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse&lt;string&gt;</returns>
Task<string> FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
///
@ -196,10 +198,11 @@ namespace Org.OpenAPITools.IApi
/// <remarks>
/// Test serialization of outer string types
/// </remarks>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse&lt;string?&gt;</returns>
Task<string?> FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<string?> FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
/// Array of Enums
@ -1294,12 +1297,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="string"/>&gt;</returns>
public async Task<string> FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null)
{
ApiResponse<string?> result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false);
ApiResponse<string?> result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false);
if (result.Content == null)
throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent);
@ -1311,15 +1315,16 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="string"/>&gt;</returns>
public async Task<string?> FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<string?> FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null)
{
ApiResponse<string?>? result = null;
try
{
result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false);
result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false);
}
catch (Exception)
{
@ -1333,19 +1338,30 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// Validates the request parameters
/// </summary>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
/// <returns></returns>
protected virtual string? OnFakeOuterStringSerialize(string? body)
protected virtual (Guid, string?) OnFakeOuterStringSerialize(Guid requiredStringUuid, string? body)
{
return body;
#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 (requiredStringUuid == null)
throw new ArgumentNullException(nameof(requiredStringUuid));
#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 (requiredStringUuid, body);
}
/// <summary>
/// Processes the server response
/// </summary>
/// <param name="apiResponse"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string?> apiResponse, string? body)
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string?> apiResponse, Guid requiredStringUuid, string? body)
{
}
@ -1355,8 +1371,9 @@ namespace Org.OpenAPITools.Api
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string? body)
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string? body)
{
Logger.LogError(exception, "An error occurred while sending the request to the server.");
}
@ -1365,16 +1382,19 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="ApiResponse{T}"/>&gt; where T : <see cref="string"/></returns>
public async Task<ApiResponse<string?>> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<ApiResponse<string?>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null)
{
UriBuilder uriBuilder = new UriBuilder();
try
{
body = OnFakeOuterStringSerialize(body);
var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body);
requiredStringUuid = validatedParameters.Item1;
body = validatedParameters.Item2;
using (HttpRequestMessage request = new HttpRequestMessage())
{
@ -1383,6 +1403,12 @@ namespace Org.OpenAPITools.Api
uriBuilder.Scheme = ClientUtils.SCHEME;
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string";
System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()!);
uriBuilder.Query = parseQueryString.ToString();
request.Content = (body as object) is System.IO.Stream stream
? request.Content = new StreamContent(stream)
: request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions));
@ -1424,7 +1450,7 @@ namespace Org.OpenAPITools.Api
if (apiResponse.IsSuccessStatusCode)
{
apiResponse.Content = JsonSerializer.Deserialize<string>(apiResponse.RawContent, _jsonSerializerOptions);
AfterFakeOuterStringSerialize(apiResponse, body);
AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body);
}
return apiResponse;
@ -1433,7 +1459,7 @@ namespace Org.OpenAPITools.Api
}
catch(Exception e)
{
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body);
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body);
throw;
}
}

View File

@ -36,12 +36,16 @@ namespace Org.OpenAPITools.Model
/// <param name="dateTime">dateTime</param>
/// <param name="map">map</param>
/// <param name="uuid">uuid</param>
/// <param name="uuidWithPattern">uuidWithPattern</param>
[JsonConstructor]
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid)
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid, Guid uuidWithPattern)
{
#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 (uuidWithPattern == null)
throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
if (uuid == null)
throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
@ -57,6 +61,7 @@ namespace Org.OpenAPITools.Model
DateTime = dateTime;
Map = map;
Uuid = uuid;
UuidWithPattern = uuidWithPattern;
}
/// <summary>
@ -77,6 +82,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("uuid")]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[JsonPropertyName("uuid_with_pattern")]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@ -94,6 +105,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@ -105,6 +117,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}
@ -134,6 +153,7 @@ namespace Org.OpenAPITools.Model
DateTime dateTime = default;
Dictionary<string, Animal> map = default;
Guid uuid = default;
Guid uuidWithPattern = default;
while (utf8JsonReader.Read())
{
@ -159,13 +179,16 @@ namespace Org.OpenAPITools.Model
case "uuid":
uuid = utf8JsonReader.GetGuid();
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
break;
default:
break;
}
}
}
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid);
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern);
}
/// <summary>
@ -184,6 +207,7 @@ namespace Org.OpenAPITools.Model
writer.WritePropertyName("map");
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions);
writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid);
writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern);
writer.WriteEndObject();
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -7,6 +7,7 @@ Name | Type | Description | Notes
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]
**Uuid** | **Guid** | | [optional]
**UuidWithPattern** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api
[Fact (Skip = "not implemented")]
public async Task FakeOuterStringSerializeAsyncTest()
{
Guid requiredStringUuid = default;
string body = default;
var response = await _instance.FakeOuterStringSerializeAsync(body);
var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body);
Assert.IsType<string>(response);
}

View File

@ -128,10 +128,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task&lt;ApiResponse&lt;string&gt;&gt;</returns>
Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
///
@ -140,10 +141,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse&lt;string&gt;</returns>
Task<string> FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
/// Array of Enums
@ -1056,12 +1058,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="string"/>&gt;</returns>
public async Task<string> FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null)
{
ApiResponse<string> result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false);
ApiResponse<string> result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false);
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
if (result.Content == null)
@ -1074,19 +1077,30 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// Validates the request parameters
/// </summary>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
/// <returns></returns>
protected virtual string OnFakeOuterStringSerialize(string body)
protected virtual (Guid, string) OnFakeOuterStringSerialize(Guid requiredStringUuid, string body)
{
return body;
#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 (requiredStringUuid == null)
throw new ArgumentNullException(nameof(requiredStringUuid));
#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 (requiredStringUuid, body);
}
/// <summary>
/// Processes the server response
/// </summary>
/// <param name="apiResponse"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string> apiResponse, string body)
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string> apiResponse, Guid requiredStringUuid, string body)
{
}
@ -1096,8 +1110,9 @@ namespace Org.OpenAPITools.Api
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string body)
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string body)
{
Logger.LogError(exception, "An error occurred while sending the request to the server.");
}
@ -1106,16 +1121,19 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="ApiResponse{T}"/>&gt; where T : <see cref="string"/></returns>
public async Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null)
{
UriBuilder uriBuilder = new UriBuilder();
try
{
body = OnFakeOuterStringSerialize(body);
var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body);
requiredStringUuid = validatedParameters.Item1;
body = validatedParameters.Item2;
using (HttpRequestMessage request = new HttpRequestMessage())
{
@ -1124,6 +1142,12 @@ namespace Org.OpenAPITools.Api
uriBuilder.Scheme = ClientUtils.SCHEME;
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string";
System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString());
uriBuilder.Query = parseQueryString.ToString();
request.Content = (body as object) is System.IO.Stream stream
? request.Content = new StreamContent(stream)
: request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions));
@ -1165,7 +1189,7 @@ namespace Org.OpenAPITools.Api
if (apiResponse.IsSuccessStatusCode)
{
apiResponse.Content = JsonSerializer.Deserialize<string>(apiResponse.RawContent, _jsonSerializerOptions);
AfterFakeOuterStringSerialize(apiResponse, body);
AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body);
}
return apiResponse;
@ -1174,7 +1198,7 @@ namespace Org.OpenAPITools.Api
}
catch(Exception e)
{
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body);
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body);
throw;
}
}

View File

@ -34,12 +34,16 @@ namespace Org.OpenAPITools.Model
/// <param name="dateTime">dateTime</param>
/// <param name="map">map</param>
/// <param name="uuid">uuid</param>
/// <param name="uuidWithPattern">uuidWithPattern</param>
[JsonConstructor]
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid)
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid, Guid uuidWithPattern)
{
#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 (uuidWithPattern == null)
throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
if (uuid == null)
throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
@ -55,6 +59,7 @@ namespace Org.OpenAPITools.Model
DateTime = dateTime;
Map = map;
Uuid = uuid;
UuidWithPattern = uuidWithPattern;
}
/// <summary>
@ -75,6 +80,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("uuid")]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[JsonPropertyName("uuid_with_pattern")]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@ -92,6 +103,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@ -103,6 +115,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}
@ -132,6 +151,7 @@ namespace Org.OpenAPITools.Model
DateTime dateTime = default;
Dictionary<string, Animal> map = default;
Guid uuid = default;
Guid uuidWithPattern = default;
while (utf8JsonReader.Read())
{
@ -157,13 +177,16 @@ namespace Org.OpenAPITools.Model
case "uuid":
uuid = utf8JsonReader.GetGuid();
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
break;
default:
break;
}
}
}
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid);
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern);
}
/// <summary>
@ -182,6 +205,7 @@ namespace Org.OpenAPITools.Model
writer.WritePropertyName("map");
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions);
writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid);
writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern);
writer.WriteEndObject();
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -7,6 +7,7 @@ Name | Type | Description | Notes
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]
**Uuid** | **Guid** | | [optional]
**UuidWithPattern** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api
[Fact (Skip = "not implemented")]
public async Task FakeOuterStringSerializeAsyncTest()
{
Guid requiredStringUuid = default;
string body = default;
var response = await _instance.FakeOuterStringSerializeAsync(body);
var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body);
Assert.IsType<string>(response);
}

View File

@ -128,10 +128,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task&lt;ApiResponse&lt;string&gt;&gt;</returns>
Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
///
@ -140,10 +141,11 @@ namespace Org.OpenAPITools.IApi
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse&lt;string&gt;</returns>
Task<string> FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null);
Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null);
/// <summary>
/// Array of Enums
@ -1056,12 +1058,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="string"/>&gt;</returns>
public async Task<string> FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null)
{
ApiResponse<string> result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false);
ApiResponse<string> result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false);
#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
if (result.Content == null)
@ -1074,19 +1077,30 @@ namespace Org.OpenAPITools.Api
/// <summary>
/// Validates the request parameters
/// </summary>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
/// <returns></returns>
protected virtual string OnFakeOuterStringSerialize(string body)
protected virtual (Guid, string) OnFakeOuterStringSerialize(Guid requiredStringUuid, string body)
{
return body;
#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 (requiredStringUuid == null)
throw new ArgumentNullException(nameof(requiredStringUuid));
#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 (requiredStringUuid, body);
}
/// <summary>
/// Processes the server response
/// </summary>
/// <param name="apiResponse"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string> apiResponse, string body)
protected virtual void AfterFakeOuterStringSerialize(ApiResponse<string> apiResponse, Guid requiredStringUuid, string body)
{
}
@ -1096,8 +1110,9 @@ namespace Org.OpenAPITools.Api
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="requiredStringUuid"></param>
/// <param name="body"></param>
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string body)
protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string body)
{
Logger.LogError(exception, "An error occurred while sending the request to the server.");
}
@ -1106,16 +1121,19 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns><see cref="Task"/>&lt;<see cref="ApiResponse{T}"/>&gt; where T : <see cref="string"/></returns>
public async Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null)
public async Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null)
{
UriBuilder uriBuilder = new UriBuilder();
try
{
body = OnFakeOuterStringSerialize(body);
var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body);
requiredStringUuid = validatedParameters.Item1;
body = validatedParameters.Item2;
using (HttpRequestMessage request = new HttpRequestMessage())
{
@ -1124,6 +1142,12 @@ namespace Org.OpenAPITools.Api
uriBuilder.Scheme = ClientUtils.SCHEME;
uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string";
System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty);
parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString());
uriBuilder.Query = parseQueryString.ToString();
request.Content = (body as object) is System.IO.Stream stream
? request.Content = new StreamContent(stream)
: request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions));
@ -1165,7 +1189,7 @@ namespace Org.OpenAPITools.Api
if (apiResponse.IsSuccessStatusCode)
{
apiResponse.Content = JsonSerializer.Deserialize<string>(apiResponse.RawContent, _jsonSerializerOptions);
AfterFakeOuterStringSerialize(apiResponse, body);
AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body);
}
return apiResponse;
@ -1174,7 +1198,7 @@ namespace Org.OpenAPITools.Api
}
catch(Exception e)
{
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body);
OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body);
throw;
}
}

View File

@ -34,12 +34,16 @@ namespace Org.OpenAPITools.Model
/// <param name="dateTime">dateTime</param>
/// <param name="map">map</param>
/// <param name="uuid">uuid</param>
/// <param name="uuidWithPattern">uuidWithPattern</param>
[JsonConstructor]
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid)
public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary<string, Animal> map, Guid uuid, Guid uuidWithPattern)
{
#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 (uuidWithPattern == null)
throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
if (uuid == null)
throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null.");
@ -55,6 +59,7 @@ namespace Org.OpenAPITools.Model
DateTime = dateTime;
Map = map;
Uuid = uuid;
UuidWithPattern = uuidWithPattern;
}
/// <summary>
@ -75,6 +80,12 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("uuid")]
public Guid Uuid { get; set; }
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[JsonPropertyName("uuid_with_pattern")]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@ -92,6 +103,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@ -103,6 +115,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}
@ -132,6 +151,7 @@ namespace Org.OpenAPITools.Model
DateTime dateTime = default;
Dictionary<string, Animal> map = default;
Guid uuid = default;
Guid uuidWithPattern = default;
while (utf8JsonReader.Read())
{
@ -157,13 +177,16 @@ namespace Org.OpenAPITools.Model
case "uuid":
uuid = utf8JsonReader.GetGuid();
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
break;
default:
break;
}
}
}
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid);
return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern);
}
/// <summary>
@ -182,6 +205,7 @@ namespace Org.OpenAPITools.Model
writer.WritePropertyName("map");
JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions);
writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid);
writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern);
writer.WriteEndObject();
}

View File

@ -389,7 +389,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -416,11 +416,12 @@ namespace Example
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new FakeApi(httpClient, config, httpClientHandler);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -440,7 +441,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -457,6 +458,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -113,9 +113,10 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string));
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string));
/// <summary>
///
@ -124,9 +125,10 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string));
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string));
/// <summary>
/// Array of Enums
/// </summary>
@ -491,10 +493,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -503,10 +506,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1442,11 +1446,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string))
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1454,9 +1459,10 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string))
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1475,6 +1481,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
@ -1494,12 +1501,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1507,10 +1515,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1531,6 +1540,7 @@ namespace Org.OpenAPITools.Api
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;

View File

@ -36,17 +36,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -79,6 +87,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -125,6 +134,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -152,6 +165,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string? body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string? body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string? | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string?** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string? body = default(string?), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string? body = default(string?), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string? body = default(string?), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string? body = default(string?), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}

View File

@ -373,7 +373,7 @@ No authorization required
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> string FakeOuterStringSerialize (string body = null)
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
@ -396,11 +396,12 @@ namespace Example
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String
var body = "body_example"; // string | Input string as post body (optional)
try
{
string result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body);
Debug.WriteLine(result);
}
catch (ApiException e)
@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code
```csharp
try
{
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body);
ApiResponse<string> response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
@ -437,6 +438,7 @@ catch (ApiException e)
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredStringUuid** | **Guid** | Required UUID String | |
| **body** | **string** | Input string as post body | [optional] |
### Return type

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**UuidWithPattern** | **Guid** | | [optional]
**Uuid** | **Guid** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]

View File

@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0);
string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
///
@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0);
ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0);
/// <summary>
/// Array of Enums
/// </summary>
@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
System.Threading.Tasks.Task<ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
/// Array of Enums
/// </summary>
@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>string</returns>
public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0)
public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(body);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body);
return localVarResponse.Data;
}
@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of string</returns>
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0)
public Org.OpenAPITools.Client.ApiResponse<string> FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";
@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of string</returns>
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<string> FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false);
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api
/// Test serialization of outer string types
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="requiredStringUuid">Required UUID String</param>
/// <param name="body">Input string as post body (optional)</param>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (string)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid));
localVarRequestOptions.Data = body;
localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize";

View File

@ -35,16 +35,24 @@ namespace Org.OpenAPITools.Model
/// <summary>
/// Initializes a new instance of the <see cref="MixedPropertiesAndAdditionalPropertiesClass" /> class.
/// </summary>
/// <param name="uuidWithPattern">uuidWithPattern.</param>
/// <param name="uuid">uuid.</param>
/// <param name="dateTime">dateTime.</param>
/// <param name="map">map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary<string, Animal> map = default(Dictionary<string, Animal>))
{
this.UuidWithPattern = uuidWithPattern;
this.Uuid = uuid;
this.DateTime = dateTime;
this.Map = map;
}
/// <summary>
/// Gets or Sets UuidWithPattern
/// </summary>
[DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)]
public Guid UuidWithPattern { get; set; }
/// <summary>
/// Gets or Sets Uuid
/// </summary>
@ -71,6 +79,7 @@ namespace Org.OpenAPITools.Model
{
StringBuilder sb = new StringBuilder();
sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Map: ").Append(Map).Append("\n");
@ -116,6 +125,10 @@ namespace Org.OpenAPITools.Model
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UuidWithPattern != null)
{
hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode();
}
if (this.Uuid != null)
{
hashCode = (hashCode * 59) + this.Uuid.GetHashCode();
@ -139,6 +152,13 @@ namespace Org.OpenAPITools.Model
/// <returns>Validation Result</returns>
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
}
yield break;
}
}