[csharp] Fixed operation nested return type (#16314)

* fixed operation nested return type

* more robust fix
This commit is contained in:
devhl-labs
2023-08-14 01:07:36 -04:00
committed by GitHub
parent 83af019603
commit ef9520f989
123 changed files with 8189 additions and 12 deletions

View File

@@ -76,6 +76,8 @@ docs/Quadrilateral.md
docs/QuadrilateralInterface.md
docs/ReadOnlyFirst.md
docs/Return.md
docs/RolesReportsHash.md
docs/RolesReportsHashRole.md
docs/ScaleneTriangle.md
docs/Shape.md
docs/ShapeInterface.md
@@ -192,6 +194,8 @@ src/Org.OpenAPITools/Model/Quadrilateral.cs
src/Org.OpenAPITools/Model/QuadrilateralInterface.cs
src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
src/Org.OpenAPITools/Model/Return.cs
src/Org.OpenAPITools/Model/RolesReportsHash.cs
src/Org.OpenAPITools/Model/RolesReportsHashRole.cs
src/Org.OpenAPITools/Model/ScaleneTriangle.cs
src/Org.OpenAPITools/Model/Shape.cs
src/Org.OpenAPITools/Model/ShapeInterface.cs

View File

@@ -119,6 +119,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
*DefaultApi* | [**GetCountry**](docs/DefaultApi.md#getcountry) | **POST** /country |
*DefaultApi* | [**Hello**](docs/DefaultApi.md#hello) | **GET** /hello | Hello
*DefaultApi* | [**RolesReportGet**](docs/DefaultApi.md#rolesreportget) | **GET** /roles/report |
*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
@@ -229,6 +230,8 @@ Class | Method | HTTP request | Description
- [Model.QuadrilateralInterface](docs/QuadrilateralInterface.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Return](docs/Return.md)
- [Model.RolesReportsHash](docs/RolesReportsHash.md)
- [Model.RolesReportsHashRole](docs/RolesReportsHashRole.md)
- [Model.ScaleneTriangle](docs/ScaleneTriangle.md)
- [Model.Shape](docs/Shape.md)
- [Model.ShapeInterface](docs/ShapeInterface.md)

View File

@@ -41,6 +41,17 @@ tags:
- description: Operations about user
name: user
paths:
/roles/report:
get:
responses:
"200":
content:
application/json:
schema:
items:
$ref: '#/components/schemas/RolesReport'
type: array
description: returns report
/hello:
get:
description: Hello
@@ -1181,6 +1192,20 @@ components:
description: Pet object that needs to be added to the store
required: true
schemas:
RolesReport:
description: Roles report
items:
$ref: '#/components/schemas/RolesReportsHash'
type: array
RolesReportsHash:
description: Role report Hash
properties:
role_uuid:
format: uuid
type: string
role:
$ref: '#/components/schemas/RolesReportsHash_role'
type: object
Foo:
example:
bar: bar
@@ -2422,6 +2447,11 @@ components:
required:
- country
type: object
RolesReportsHash_role:
properties:
name:
type: string
type: object
securitySchemes:
petstore_auth:
flows:

View File

@@ -7,6 +7,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | |
<a id="fooget"></a>
# **FooGet**
@@ -259,3 +260,85 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a id="rolesreportget"></a>
# **RolesReportGet**
> List&lt;List&lt;RolesReportsHash&gt;&gt; RolesReportGet ()
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class RolesReportGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
List<List<RolesReportsHash>> result = apiInstance.RolesReportGet();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the RolesReportGetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
ApiResponse<List<List<RolesReportsHash>>> response = apiInstance.RolesReportGetWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**List<List<RolesReportsHash>>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | returns report | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.RolesReportsHash
Role report Hash
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**RoleUuid** | **Guid** | | [optional]
**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

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

View File

@@ -0,0 +1,66 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing RolesReportsHashRole
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class RolesReportsHashRoleTests : IDisposable
{
// TODO uncomment below to declare an instance variable for RolesReportsHashRole
//private RolesReportsHashRole instance;
public RolesReportsHashRoleTests()
{
// TODO uncomment below to create an instance of RolesReportsHashRole
//instance = new RolesReportsHashRole();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of RolesReportsHashRole
/// </summary>
[Fact]
public void RolesReportsHashRoleInstanceTest()
{
// TODO uncomment below to test "IsType" RolesReportsHashRole
//Assert.IsType<RolesReportsHashRole>(instance);
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Fact]
public void NameTest()
{
// TODO unit test for the property 'Name'
}
}
}

View File

@@ -0,0 +1,75 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing RolesReportsHash
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class RolesReportsHashTests : IDisposable
{
// TODO uncomment below to declare an instance variable for RolesReportsHash
//private RolesReportsHash instance;
public RolesReportsHashTests()
{
// TODO uncomment below to create an instance of RolesReportsHash
//instance = new RolesReportsHash();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of RolesReportsHash
/// </summary>
[Fact]
public void RolesReportsHashInstanceTest()
{
// TODO uncomment below to test "IsType" RolesReportsHash
//Assert.IsType<RolesReportsHash>(instance);
}
/// <summary>
/// Test the property 'RoleUuid'
/// </summary>
[Fact]
public void RoleUuidTest()
{
// TODO unit test for the property 'RoleUuid'
}
/// <summary>
/// Test the property 'Role'
/// </summary>
[Fact]
public void RoleTest()
{
// TODO unit test for the property 'Role'
}
}
}

View File

@@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of List&lt;Guid&gt;</returns>
ApiResponse<List<Guid>> HelloWithHttpInfo(int operationIndex = 0);
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
List<List<RolesReportsHash>> RolesReportGet(int operationIndex = 0);
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
ApiResponse<List<List<RolesReportsHash>>> RolesReportGetWithHttpInfo(int operationIndex = 0);
#endregion Synchronous Operations
}
@@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;Guid&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<Guid>>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
System.Threading.Tasks.Task<List<List<RolesReportsHash>>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;List&lt;RolesReportsHash&gt;&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<List<RolesReportsHash>>>> RolesReportGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
#endregion Asynchronous Operations
}
@@ -680,5 +721,131 @@ namespace Org.OpenAPITools.Api
return localVarResponse;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public List<List<RolesReportsHash>> RolesReportGet(int operationIndex = 0)
{
Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> localVarResponse = RolesReportGetWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <returns>ApiResponse of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> RolesReportGetWithHttpInfo(int operationIndex = 0)
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.Operation = "DefaultApi.RolesReportGet";
localVarRequestOptions.OperationIndex = operationIndex;
// make the HTTP request
var localVarResponse = this.Client.Get<List<List<RolesReportsHash>>>("/roles/report", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public async System.Threading.Tasks.Task<List<List<RolesReportsHash>>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false);
return localVarResponse.Data;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="operationIndex">Index associated with the operation.</param>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;List&lt;RolesReportsHash&gt;&gt;)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>>> RolesReportGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null)
{
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
}
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
localVarRequestOptions.Operation = "DefaultApi.RolesReportGet";
localVarRequestOptions.OperationIndex = operationIndex;
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.GetAsync<List<List<RolesReportsHash>>>("/roles/report", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse);
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
}
}
}

View File

@@ -0,0 +1,145 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// Role report Hash
/// </summary>
[DataContract(Name = "RolesReportsHash")]
public partial class RolesReportsHash : IEquatable<RolesReportsHash>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="RolesReportsHash" /> class.
/// </summary>
/// <param name="roleUuid">roleUuid.</param>
/// <param name="role">role.</param>
public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole))
{
this.RoleUuid = roleUuid;
this.Role = role;
this.AdditionalProperties = new Dictionary<string, object>();
}
/// <summary>
/// Gets or Sets RoleUuid
/// </summary>
[DataMember(Name = "role_uuid", EmitDefaultValue = false)]
public Guid RoleUuid { get; set; }
/// <summary>
/// Gets or Sets Role
/// </summary>
[DataMember(Name = "role", EmitDefaultValue = false)]
public RolesReportsHashRole Role { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RolesReportsHash {\n");
sb.Append(" RoleUuid: ").Append(RoleUuid).Append("\n");
sb.Append(" Role: ").Append(Role).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual;
}
/// <summary>
/// Returns true if RolesReportsHash instances are equal
/// </summary>
/// <param name="input">Instance of RolesReportsHash to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(RolesReportsHash input)
{
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.RoleUuid != null)
{
hashCode = (hashCode * 59) + this.RoleUuid.GetHashCode();
}
if (this.Role != null)
{
hashCode = (hashCode * 59) + this.Role.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
}
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

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