diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 9c1d243baf6..1f867e843c6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -542,7 +542,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co if (allOf != null) { for (CodegenProperty property : allOf) { property.name = patchPropertyName(model, property.baseType); - patchPropertyVendorExtensinos(property); + patchPropertyVendorExtensions(property); } } @@ -552,7 +552,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co for (CodegenProperty property : anyOf) { property.name = patchPropertyName(model, property.baseType); property.isNullable = true; - patchPropertyVendorExtensinos(property); + patchPropertyVendorExtensions(property); } } @@ -562,7 +562,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co for (CodegenProperty property : oneOf) { property.name = patchPropertyName(model, property.baseType); property.isNullable = true; - patchPropertyVendorExtensinos(property); + patchPropertyVendorExtensions(property); } } } @@ -637,7 +637,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co return value; } - private void patchPropertyVendorExtensinos(CodegenProperty property) { + private void patchPropertyVendorExtensions(CodegenProperty property) { Boolean isValueType = isValueType(property); property.vendorExtensions.put("x-is-value-type", isValueType); property.vendorExtensions.put("x-is-reference-type", !isValueType); @@ -657,7 +657,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co property.isPrimitiveType = true; } - patchPropertyVendorExtensinos(property); + patchPropertyVendorExtensions(property); String tmpPropertyName = escapeReservedWord(model, property.name); property.name = patchPropertyName(model, property.name); @@ -741,13 +741,10 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // Check return types for collection if (operation.returnType != null) { - String typeMapping; int namespaceEnd = operation.returnType.lastIndexOf("."); - if (namespaceEnd > 0) { - typeMapping = operation.returnType.substring(namespaceEnd); - } else { - typeMapping = operation.returnType; - } + String typeMapping = namespaceEnd > 0 + ? operation.returnType.substring(namespaceEnd) + : operation.returnType; if (this.collectionTypes.contains(typeMapping)) { operation.isArray = true; @@ -895,7 +892,23 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co } protected void processOperation(CodegenOperation operation) { - // default noop + String[] nestedTypes = { "List", "Collection", "ICollection", "Dictionary" }; + + Arrays.stream(nestedTypes).forEach(nestedType -> { + if (operation.returnProperty != null && operation.returnType.contains("<" + nestedType + ">") && operation.returnProperty.items != null) { + String nestedReturnType = operation.returnProperty.items.dataType; + operation.returnType = operation.returnType.replace("<" + nestedType + ">", "<" + nestedReturnType + ">"); + operation.returnProperty.dataType = operation.returnType; + operation.returnProperty.datatypeWithEnum = operation.returnType; + } + + if (operation.returnProperty != null && operation.returnType.contains(", " + nestedType + ">") && operation.returnProperty.items != null) { + String nestedReturnType = operation.returnProperty.items.dataType; + operation.returnType = operation.returnType.replace(", " + nestedType + ">", ", " + nestedReturnType + ">"); + operation.returnProperty.dataType = operation.returnType; + operation.returnProperty.datatypeWithEnum = operation.returnType; + } + }); } protected void updateCodegenParameterEnumLegacy(CodegenParameter parameter, CodegenModel model) { diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index c15d9bcac9a..b9b8ac60c26 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -17,6 +17,17 @@ tags: - name: user description: Operations about user paths: + /roles/report: + get: + responses: + '200': + description: returns report + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RolesReport' /hello: get: summary: Hello @@ -1276,6 +1287,23 @@ components: type: http scheme: signature schemas: + RolesReport: + description: Roles report + type: array + items: + $ref: '#/components/schemas/RolesReportsHash' + RolesReportsHash: + description: Role report Hash + type: object + properties: + role_uuid: + type: string + format: uuid + role: + type: object + properties: + name: + type: string Foo: type: object properties: diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES index 71c7c4d5427..12fc06c2c31 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/.openapi-generator/FILES @@ -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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md index d63a03725fc..34888b871e0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/README.md @@ -107,6 +107,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 | @@ -217,6 +218,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) diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..ecb81e4314f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,189 @@ +/* + * 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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this._RoleUuid = roleUuid; + if (this.RoleUuid != null) + { + this._flagRoleUuid = true; + } + this._Role = role; + if (this.Role != null) + { + this._flagRole = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid + { + get{ return _RoleUuid;} + set + { + _RoleUuid = value; + _flagRoleUuid = true; + } + } + private Guid _RoleUuid; + private bool _flagRoleUuid; + + /// + /// Returns false as RoleUuid should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeRoleUuid() + { + return _flagRoleUuid; + } + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role + { + get{ return _Role;} + set + { + _Role = value; + _flagRole = true; + } + } + private RolesReportsHashRole _Role; + private bool _flagRole; + + /// + /// Returns false as Role should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeRole() + { + return _flagRole; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..56b5260d906 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,154 @@ +/* + * 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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this._Name = name; + if (this.Name != null) + { + this._flagName = true; + } + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name + { + get{ return _Name;} + set + { + _Name = value; + _flagName = true; + } + } + private string _Name; + private bool _flagName; + + /// + /// Returns false as Name should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeName() + { + return _flagName; + } + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES index 04ee5f80fe4..5dc99b0dddf 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/.openapi-generator/FILES @@ -78,6 +78,8 @@ docs/models/Quadrilateral.md docs/models/QuadrilateralInterface.md docs/models/ReadOnlyFirst.md docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md docs/models/ScaleneTriangle.md docs/models/Shape.md docs/models/ShapeInterface.md @@ -200,6 +202,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md index 13dffacfbde..e4639d3f928 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/apis/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/docs/models/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -0,0 +1,65 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -0,0 +1,74 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs index 7f4b994c9b1..7bdbcc9fddb 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -99,6 +99,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task<ApiResponse>List<Guid>>?> Task>?> HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<List<RolesReportsHash>>>> + Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>List<List<RolesReportsHash>>>?> + Task>>?> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); } /// @@ -166,6 +187,26 @@ namespace Org.OpenAPITools.Api { OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler>>>? OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler? OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(ApiResponse>> apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs>>(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -614,5 +655,120 @@ namespace Org.OpenAPITools.Api throw; } } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(ApiResponse>> apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, ApiResponse>> apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>?> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress!.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string? acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ApiResponse>> apiResponseLocalVar = new ApiResponse>>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs index bb209290607..99692585b59 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -114,6 +114,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); _jsonOptions.Converters.Add(new ShapeJsonConverter()); _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..6989b8e6258 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,184 @@ +// +/* + * 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 + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(RolesReportsHashRole role, Guid roleUuid) + { + Role = role; + RoleUuid = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + RolesReportsHashRole? role = default; + Guid? roleUuid = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = utf8JsonReader.GetGuid(); + break; + default: + break; + } + } + } + + if (role == null) + throw new ArgumentNullException(nameof(role), "Property is required for class RolesReportsHash."); + + if (roleUuid == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is required for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + writer.WriteString("role_uuid", rolesReportsHash.RoleUuid); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..84ec81c0eda --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,164 @@ +// +/* + * 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 + */ + +#nullable enable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(string name) + { + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string? name = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string? propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "name": + name = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES index 04ee5f80fe4..5dc99b0dddf 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/.openapi-generator/FILES @@ -78,6 +78,8 @@ docs/models/Quadrilateral.md docs/models/QuadrilateralInterface.md docs/models/ReadOnlyFirst.md docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md docs/models/ScaleneTriangle.md docs/models/Shape.md docs/models/ShapeInterface.md @@ -200,6 +202,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md index 13dffacfbde..e4639d3f928 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/apis/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/docs/models/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -0,0 +1,65 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -0,0 +1,74 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 3568c1f6333..be380f20743 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -97,6 +97,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task<ApiResponse>List<Guid>>> Task>> HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<List<RolesReportsHash>>>> + Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>List<List<RolesReportsHash>>>> + Task>>> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); } /// @@ -164,6 +185,26 @@ namespace Org.OpenAPITools.Api { OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler>>> OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(ApiResponse>> apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs>>(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -612,5 +653,120 @@ namespace Org.OpenAPITools.Api throw; } } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(ApiResponse>> apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, ApiResponse>> apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + + httpRequestMessageLocalVar.Method = HttpMethod.Get; + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ApiResponse>> apiResponseLocalVar = new ApiResponse>>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index f7ba191b19c..ac29e520fa4 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -112,6 +112,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); _jsonOptions.Converters.Add(new ShapeJsonConverter()); _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..0c9095c81b9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,182 @@ +// +/* + * 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.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(RolesReportsHashRole role, Guid roleUuid) + { + Role = role; + RoleUuid = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + RolesReportsHashRole role = default; + Guid? roleUuid = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = utf8JsonReader.GetGuid(); + break; + default: + break; + } + } + } + + if (role == null) + throw new ArgumentNullException(nameof(role), "Property is required for class RolesReportsHash."); + + if (roleUuid == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is required for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + writer.WriteString("role_uuid", rolesReportsHash.RoleUuid); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..293d94dabd1 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,162 @@ +// +/* + * 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.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(string name) + { + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string name = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "name": + name = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES index 04ee5f80fe4..5dc99b0dddf 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/.openapi-generator/FILES @@ -78,6 +78,8 @@ docs/models/Quadrilateral.md docs/models/QuadrilateralInterface.md docs/models/ReadOnlyFirst.md docs/models/Return.md +docs/models/RolesReportsHash.md +docs/models/RolesReportsHashRole.md docs/models/ScaleneTriangle.md docs/models/Shape.md docs/models/ShapeInterface.md @@ -200,6 +202,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md index 13dffacfbde..e4639d3f928 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/apis/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHash.md new file mode 100644 index 00000000000..d92c01de9ef --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHash.md @@ -0,0 +1,12 @@ +# Org.OpenAPITools.Model.RolesReportsHash +Role report Hash + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional] +**RoleUuid** | **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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHashRole.md new file mode 100644 index 00000000000..760f77b30e7 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/docs/models/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..5f21a874c4f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -0,0 +1,65 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..cddb8dc6f0b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -0,0 +1,74 @@ +/* + * 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; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 5110738866a..9257fc61617 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -97,6 +97,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task<ApiResponse>List<Guid>>> Task>> HelloOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task<ApiResponse<List<List<RolesReportsHash>>>> + Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default); + + /// + /// + /// + /// + /// + /// + /// Cancellation Token to cancel the request. + /// Task<ApiResponse>List<List<RolesReportsHash>>>> + Task>>> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default); } /// @@ -164,6 +185,26 @@ namespace Org.OpenAPITools.Api { OnErrorHello?.Invoke(this, new ExceptionEventArgs(exception)); } + + /// + /// The event raised after the server response + /// + public event EventHandler>>> OnRolesReportGet; + + /// + /// The event raised after an error querying the server + /// + public event EventHandler OnErrorRolesReportGet; + + internal void ExecuteOnRolesReportGet(ApiResponse>> apiResponse) + { + OnRolesReportGet?.Invoke(this, new ApiResponseEventArgs>>(apiResponse)); + } + + internal void ExecuteOnErrorRolesReportGet(Exception exception) + { + OnErrorRolesReportGet?.Invoke(this, new ExceptionEventArgs(exception)); + } } /// @@ -610,5 +651,119 @@ namespace Org.OpenAPITools.Api throw; } } + + /// + /// Processes the server response + /// + /// + private void AfterRolesReportGetDefaultImplementation(ApiResponse>> apiResponseLocalVar) + { + bool suppressDefaultLog = false; + AfterRolesReportGet(ref suppressDefaultLog, apiResponseLocalVar); + if (!suppressDefaultLog) + Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); + } + + /// + /// Processes the server response + /// + /// + /// + partial void AfterRolesReportGet(ref bool suppressDefaultLog, ApiResponse>> apiResponseLocalVar); + + /// + /// Logs exceptions that occur while retrieving the server response + /// + /// + /// + /// + private void OnErrorRolesReportGetDefaultImplementation(Exception exception, string pathFormat, string path) + { + bool suppressDefaultLog = false; + OnErrorRolesReportGet(ref suppressDefaultLog, exception, pathFormat, path); + if (!suppressDefaultLog) + Logger.LogError(exception, "An error occurred while sending the request to the server."); + } + + /// + /// A partial method that gives developers a way to provide customized exception handling + /// + /// + /// + /// + /// + partial void OnErrorRolesReportGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path); + + /// + /// + /// + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>> RolesReportGetOrDefaultAsync(System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await RolesReportGetAsync(cancellationToken).ConfigureAwait(false); + } + catch (Exception) + { + return null; + } + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// <> where T : + public async Task>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default) + { + UriBuilder uriBuilderLocalVar = new UriBuilder(); + + try + { + using (HttpRequestMessage httpRequestMessageLocalVar = new HttpRequestMessage()) + { + uriBuilderLocalVar.Host = HttpClient.BaseAddress.Host; + uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; + uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; + uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "/roles/report"; + + httpRequestMessageLocalVar.RequestUri = uriBuilderLocalVar.Uri; + + string[] acceptLocalVars = new string[] { + "application/json" + }; + + string acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + + if (acceptLocalVar != null) + httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + httpRequestMessageLocalVar.Method = new HttpMethod("GET"); + + DateTime requestedAtLocalVar = DateTime.UtcNow; + + using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) + { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync().ConfigureAwait(false); + + ApiResponse>> apiResponseLocalVar = new ApiResponse>>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "/roles/report", requestedAtLocalVar, _jsonSerializerOptions); + + AfterRolesReportGetDefaultImplementation(apiResponseLocalVar); + + Events.ExecuteOnRolesReportGet(apiResponseLocalVar); + + return apiResponseLocalVar; + } + } + } + catch(Exception e) + { + OnErrorRolesReportGetDefaultImplementation(e, "/roles/report", uriBuilderLocalVar.Path); + Events.ExecuteOnErrorRolesReportGet(e); + throw; + } + } } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs index f7ba191b19c..ac29e520fa4 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Client/HostConfiguration.cs @@ -112,6 +112,8 @@ namespace Org.OpenAPITools.Client _jsonOptions.Converters.Add(new QuadrilateralInterfaceJsonConverter()); _jsonOptions.Converters.Add(new ReadOnlyFirstJsonConverter()); _jsonOptions.Converters.Add(new ReturnJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashJsonConverter()); + _jsonOptions.Converters.Add(new RolesReportsHashRoleJsonConverter()); _jsonOptions.Converters.Add(new ScaleneTriangleJsonConverter()); _jsonOptions.Converters.Add(new ShapeJsonConverter()); _jsonOptions.Converters.Add(new ShapeInterfaceJsonConverter()); diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..0c9095c81b9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,182 @@ +// +/* + * 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.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Role report Hash + /// + public partial class RolesReportsHash : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// role + /// roleUuid + [JsonConstructor] + public RolesReportsHash(RolesReportsHashRole role, Guid roleUuid) + { + Role = role; + RoleUuid = roleUuid; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Role + /// + [JsonPropertyName("role")] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets RoleUuid + /// + [JsonPropertyName("role_uuid")] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RolesReportsHash {\n"); + sb.Append(" Role: ").Append(Role).Append("\n"); + sb.Append(" RoleUuid: ").Append(RoleUuid).Append("\n"); + sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHash Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + RolesReportsHashRole role = default; + Guid? roleUuid = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "role": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + role = JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions); + break; + case "role_uuid": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + roleUuid = utf8JsonReader.GetGuid(); + break; + default: + break; + } + } + } + + if (role == null) + throw new ArgumentNullException(nameof(role), "Property is required for class RolesReportsHash."); + + if (roleUuid == null) + throw new ArgumentNullException(nameof(roleUuid), "Property is required for class RolesReportsHash."); + + return new RolesReportsHash(role, roleUuid.Value); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHash, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHash rolesReportsHash, JsonSerializerOptions jsonSerializerOptions) + { + writer.WritePropertyName("role"); + JsonSerializer.Serialize(writer, rolesReportsHash.Role, jsonSerializerOptions); + writer.WriteString("role_uuid", rolesReportsHash.RoleUuid); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..293d94dabd1 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,162 @@ +// +/* + * 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.Text; +using System.Text.RegularExpressions; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.ComponentModel.DataAnnotations; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// RolesReportsHashRole + /// + public partial class RolesReportsHashRole : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name + [JsonConstructor] + public RolesReportsHashRole(string name) + { + Name = name; + OnCreated(); + } + + partial void OnCreated(); + + /// + /// Gets or Sets Name + /// + [JsonPropertyName("name")] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public Dictionary AdditionalProperties { get; } = new Dictionary(); + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + + /// + /// A Json converter for type + /// + public class RolesReportsHashRoleJsonConverter : JsonConverter + { + /// + /// Deserializes json to + /// + /// + /// + /// + /// + /// + public override RolesReportsHashRole Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert, JsonSerializerOptions jsonSerializerOptions) + { + int currentDepth = utf8JsonReader.CurrentDepth; + + if (utf8JsonReader.TokenType != JsonTokenType.StartObject && utf8JsonReader.TokenType != JsonTokenType.StartArray) + throw new JsonException(); + + JsonTokenType startingTokenType = utf8JsonReader.TokenType; + + string name = default; + + while (utf8JsonReader.Read()) + { + if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (startingTokenType == JsonTokenType.StartArray && utf8JsonReader.TokenType == JsonTokenType.EndArray && currentDepth == utf8JsonReader.CurrentDepth) + break; + + if (utf8JsonReader.TokenType == JsonTokenType.PropertyName && currentDepth == utf8JsonReader.CurrentDepth - 1) + { + string propertyName = utf8JsonReader.GetString(); + utf8JsonReader.Read(); + + switch (propertyName) + { + case "name": + name = utf8JsonReader.GetString(); + break; + default: + break; + } + } + } + + if (name == null) + throw new ArgumentNullException(nameof(name), "Property is required for class RolesReportsHashRole."); + + return new RolesReportsHashRole(name); + } + + /// + /// Serializes a + /// + /// + /// + /// + /// + public override void Write(Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteStartObject(); + + WriteProperties(ref writer, rolesReportsHashRole, jsonSerializerOptions); + writer.WriteEndObject(); + } + + /// + /// Serializes the properties of + /// + /// + /// + /// + /// + public void WriteProperties(ref Utf8JsonWriter writer, RolesReportsHashRole rolesReportsHashRole, JsonSerializerOptions jsonSerializerOptions) + { + writer.WriteString("name", rolesReportsHashRole.Name); + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES index 85b9e2c66da..35c28731341 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/.openapi-generator/FILES @@ -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 @@ -189,6 +191,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md index dc375eca03e..e2bcf9ed1d6 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/README.md @@ -132,6 +132,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 | @@ -242,6 +243,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) diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/DefaultApi.md index ae91d727567..15d141b82f2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/DefaultApi.md @@ -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 | | # **FooGet** @@ -271,3 +272,89 @@ 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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> RolesReportGet () + + + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using System.Net.Http; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class RolesReportGetExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "http://petstore.swagger.io:80/v2"; + // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes + HttpClient httpClient = new HttpClient(); + HttpClientHandler httpClientHandler = new HttpClientHandler(); + var apiInstance = new DefaultApi(httpClient, config, httpClientHandler); + + try + { + List> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs index a6f788ddcb2..b9123e6f80a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -80,6 +80,22 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(); + /// + /// + /// + /// Thrown when fails to make API call + /// List<List<RolesReportsHash>> + List> RolesReportGet(); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(); #endregion Synchronous Operations } @@ -154,6 +170,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> RolesReportGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -682,5 +719,106 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// + /// + /// Thrown when fails to make API call + /// List<List<RolesReportsHash>> + public List> RolesReportGet() + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> RolesReportGetWithHttpInfo() + { + 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); + + + + // make the HTTP request + var localVarResponse = this.Client.Get>>("/roles/report", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> RolesReportGetWithHttpInfoAsync(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); + + + + // make the HTTP request + + var localVarResponse = await this.AsynchronousClient.GetAsync>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..b442fc8ccd9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,146 @@ +/* + * 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 FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..8b489e260da --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,133 @@ +/* + * 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 FileParameter = Org.OpenAPITools.Client.FileParameter; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; + +namespace Org.OpenAPITools.Model +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES index 71c7c4d5427..12fc06c2c31 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/.openapi-generator/FILES @@ -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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md index 12727d91225..10c43e4e1a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/README.md @@ -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) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..50995f4a505 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..a2aa2f39a49 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net47/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES index 71c7c4d5427..12fc06c2c31 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/.openapi-generator/FILES @@ -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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md index 12727d91225..10c43e4e1a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/README.md @@ -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) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..50995f4a505 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..a2aa2f39a49 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net48/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES index 71c7c4d5427..12fc06c2c31 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/.openapi-generator/FILES @@ -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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md index 12727d91225..10c43e4e1a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/README.md @@ -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) diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..50995f4a505 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..a2aa2f39a49 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES index f43efca2b9d..17b920f10cc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/.openapi-generator/FILES @@ -74,6 +74,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 @@ -188,6 +190,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md index c81080b8ac1..65098aac0b2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/README.md @@ -93,6 +93,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | *DefaultApi* | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | *DefaultApi* | [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello +*DefaultApi* | [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | *FakeApi* | [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint *FakeApi* | [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | @@ -203,6 +204,8 @@ Class | Method | HTTP request | Description - [Model.QuadrilateralInterface](QuadrilateralInterface.md) - [Model.ReadOnlyFirst](ReadOnlyFirst.md) - [Model.Return](Return.md) + - [Model.RolesReportsHash](RolesReportsHash.md) + - [Model.RolesReportsHashRole](RolesReportsHashRole.md) - [Model.ScaleneTriangle](ScaleneTriangle.md) - [Model.Shape](Shape.md) - [Model.ShapeInterface](ShapeInterface.md) diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..a6cb62f70aa --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Test] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Test] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..c2053d6deb4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -0,0 +1,74 @@ +/* + * 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.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; +using NUnit.Framework; + +namespace Org.OpenAPITools.Test.Model +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Test] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Test] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + /// + /// Test the property 'Role' + /// + [Test] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs index f9182ee8f45..abb190e8f63 100644 --- a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -79,6 +79,22 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(); + /// + /// + /// + /// Thrown when fails to make API call + /// List<List<RolesReportsHash>> + List> RolesReportGet(); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(); #endregion Synchronous Operations } @@ -153,6 +169,27 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> RolesReportGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); #endregion Asynchronous Operations } @@ -645,5 +682,117 @@ namespace Org.OpenAPITools.Api return localVarResponse; } + /// + /// + /// + /// Thrown when fails to make API call + /// List<List<RolesReportsHash>> + public List> RolesReportGet() + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> RolesReportGetWithHttpInfo() + { + 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); + + + + // make the HTTP request + var localVarResponse = this.Client.Get>>("/roles/report", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var task = RolesReportGetWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await task.ConfigureAwait(false); +#else + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> RolesReportGetWithHttpInfoAsync(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); + + + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync>>("/roles/report", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..60b9ac5c000 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,136 @@ +/* + * 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as RolesReportsHash); + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + if (input == null) + { + return false; + } + return + ( + this.RoleUuid == input.RoleUuid || + (this.RoleUuid != null && + this.RoleUuid.Equals(input.RoleUuid)) + ) && + ( + this.Role == input.Role || + (this.Role != null && + this.Role.Equals(input.Role)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + 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(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..0fe9ed28284 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient-unityWebRequest/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,118 @@ +/* + * 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 OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as RolesReportsHashRole); + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + if (input == null) + { + return false; + } + return + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES index d1ae5aa8d93..37723b6c9cb 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -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 @@ -191,6 +193,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 diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index d63a03725fc..34888b871e0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -107,6 +107,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 | @@ -217,6 +218,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) diff --git a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClient/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..50995f4a505 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..a2aa2f39a49 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + this.AdditionalProperties = new Dictionary(); + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets additional properties + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES index d1ae5aa8d93..37723b6c9cb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/OpenAPIClientCore/.openapi-generator/FILES @@ -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 @@ -191,6 +193,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 diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/README.md b/samples/client/petstore/csharp/OpenAPIClientCore/README.md index 12727d91225..10c43e4e1a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/README.md @@ -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) diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml index 4dc18f7f110..32f67b442f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml +++ b/samples/client/petstore/csharp/OpenAPIClientCore/api/openapi.yaml @@ -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: diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/DefaultApi.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/DefaultApi.md index cda989ce6ba..0b75771ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/DefaultApi.md @@ -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 | | # **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) + +# **RolesReportGet** +> List<List<RolesReportsHash>> 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> 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>> 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>** + +### 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) + diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHash.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHash.md new file mode 100644 index 00000000000..309b0c02615 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHash.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHashRole.md b/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHashRole.md new file mode 100644 index 00000000000..6f9affc2403 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/docs/RolesReportsHashRole.md @@ -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) + diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs new file mode 100644 index 00000000000..8aef6cd974f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashRoleTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHashRole + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHashRole + /// + [Fact] + public void RolesReportsHashRoleInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHashRole + //Assert.IsType(instance); + } + + /// + /// Test the property 'Name' + /// + [Fact] + public void NameTest() + { + // TODO unit test for the property 'Name' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs new file mode 100644 index 00000000000..190f1e90210 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools.Test/Model/RolesReportsHashTests.cs @@ -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 +{ + /// + /// Class for testing RolesReportsHash + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + 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. + } + + /// + /// Test an instance of RolesReportsHash + /// + [Fact] + public void RolesReportsHashInstanceTest() + { + // TODO uncomment below to test "IsType" RolesReportsHash + //Assert.IsType(instance); + } + + /// + /// Test the property 'RoleUuid' + /// + [Fact] + public void RoleUuidTest() + { + // TODO unit test for the property 'RoleUuid' + } + + /// + /// Test the property 'Role' + /// + [Fact] + public void RoleTest() + { + // TODO unit test for the property 'Role' + } + } +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs index 1b487bc9248..ad8969b7bf7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Api/DefaultApi.cs @@ -86,6 +86,24 @@ namespace Org.OpenAPITools.Api /// Index associated with the operation. /// ApiResponse of List<Guid> ApiResponse> HelloWithHttpInfo(int operationIndex = 0); + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + List> RolesReportGet(int operationIndex = 0); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + ApiResponse>> RolesReportGetWithHttpInfo(int operationIndex = 0); #endregion Synchronous Operations } @@ -166,6 +184,29 @@ namespace Org.OpenAPITools.Api /// Cancellation Token to cancel the request. /// Task of ApiResponse (List<Guid>) System.Threading.Tasks.Task>> HelloWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// + /// + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + System.Threading.Tasks.Task>>> 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; } + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// List<List<RolesReportsHash>> + public List> RolesReportGet(int operationIndex = 0) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = RolesReportGetWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// ApiResponse of List<List<RolesReportsHash>> + public Org.OpenAPITools.Client.ApiResponse>> 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>>("/roles/report", localVarRequestOptions, this.Configuration); + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse); + if (_exception != null) + { + throw _exception; + } + } + + return localVarResponse; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of List<List<RolesReportsHash>> + public async System.Threading.Tasks.Task>> RolesReportGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + Org.OpenAPITools.Client.ApiResponse>> localVarResponse = await RolesReportGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); + return localVarResponse.Data; + } + + /// + /// + /// + /// Thrown when fails to make API call + /// Index associated with the operation. + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (List<List<RolesReportsHash>>) + public async System.Threading.Tasks.Task>>> 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>>("/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; + } + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHash.cs new file mode 100644 index 00000000000..be4188cbdcf --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -0,0 +1,133 @@ +/* + * 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 +{ + /// + /// Role report Hash + /// + [DataContract(Name = "RolesReportsHash")] + public partial class RolesReportsHash : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// roleUuid. + /// role. + public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole)) + { + this.RoleUuid = roleUuid; + this.Role = role; + } + + /// + /// Gets or Sets RoleUuid + /// + [DataMember(Name = "role_uuid", EmitDefaultValue = false)] + public Guid RoleUuid { get; set; } + + /// + /// Gets or Sets Role + /// + [DataMember(Name = "role", EmitDefaultValue = false)] + public RolesReportsHashRole Role { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + 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("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHash).AreEqual; + } + + /// + /// Returns true if RolesReportsHash instances are equal + /// + /// Instance of RolesReportsHash to be compared + /// Boolean + public bool Equals(RolesReportsHash input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + 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(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs new file mode 100644 index 00000000000..3104bca1342 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientCore/src/Org.OpenAPITools/Model/RolesReportsHashRole.cs @@ -0,0 +1,120 @@ +/* + * 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 +{ + /// + /// RolesReportsHashRole + /// + [DataContract(Name = "RolesReportsHash_role")] + public partial class RolesReportsHashRole : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public RolesReportsHashRole(string name = default(string)) + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class RolesReportsHashRole {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input as RolesReportsHashRole).AreEqual; + } + + /// + /// Returns true if RolesReportsHashRole instances are equal + /// + /// Instance of RolesReportsHashRole to be compared + /// Boolean + public bool Equals(RolesReportsHashRole input) + { + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Name != null) + { + hashCode = (hashCode * 59) + this.Name.GetHashCode(); + } + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +}