diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore index 47f5505f..4ed33e02 100644 --- a/.openapi-generator-ignore +++ b/.openapi-generator-ignore @@ -1,21 +1,8 @@ appveyor.yml git_push.sh api/openapi.yaml +src/OpenFga.Sdk.Test/Api/* +src/OpenFga.Sdk.Test/Client/* src/OpenFga.Sdk.Test/Model/* src/OpenFga.Sdk/ApiClient.cs -src/OpenFga.Sdk/Client/ApiException.cs -src/OpenFga.Sdk/Client/ApiResponse.cs -src/OpenFga.Sdk/Client/ClientUtils.cs -src/OpenFga.Sdk/Client/Configuration.cs -src/OpenFga.Sdk/Client/ExceptionFactory.cs -src/OpenFga.Sdk/Client/FileParameter.cs -src/OpenFga.Sdk/Client/GlobalConfiguration.cs -src/OpenFga.Sdk/Client/IApiAccessor.cs -src/OpenFga.Sdk/Client/IAsynchronousClient.cs -src/OpenFga.Sdk/Client/IReadableConfiguration.cs -src/OpenFga.Sdk/Client/ISynchronousClient.cs -src/OpenFga.Sdk/Client/Multimap.cs -src/OpenFga.Sdk/Client/OpenAPIDateConverter.cs -src/OpenFga.Sdk/Client/RequestOptions.cs -src/OpenFga.Sdk/Client/RetryConfiguration.cs -src/OpenFga.Sdk/Client/WebRequestPathBuilder.cs +src/OpenFga.Sdk/Client/* diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 84adcacb..72b9ec86 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,20 +1,14 @@ .codecov.yml -.editorconfig -.fossa.yml .github/CODEOWNERS .github/ISSUE_TEMPLATE/bug_report.yaml .github/ISSUE_TEMPLATE/config.yaml .github/ISSUE_TEMPLATE/feature_request.yaml .gitignore -CHANGELOG.md CONTRIBUTING.md LICENSE OpenFga.Sdk.sln -OpenTelemetry.md README.md -SUPPORTED_FRAMEWORKS.md VERSION.txt -assets/FGAIcon.png docs/AbortedMessageResponse.md docs/Any.md docs/Assertion.md @@ -102,87 +96,9 @@ docs/WriteAuthorizationModelResponse.md docs/WriteRequest.md docs/WriteRequestDeletes.md docs/WriteRequestWrites.md -example/Example1/Example1.cs -example/Example1/Example1.csproj -example/Makefile -example/OpenTelemetryExample/.env.example -example/OpenTelemetryExample/OpenTelemetryExample.cs -example/OpenTelemetryExample/OpenTelemetryExample.csproj -example/README.md -src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs -src/OpenFga.Sdk.Test/ApiClient/OAuth2ClientTests.cs -src/OpenFga.Sdk.Test/ApiClient/RetryHandlerTests.cs -src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs -src/OpenFga.Sdk.Test/Models/Client/ClientBatchCheckResponseTest.cs -src/OpenFga.Sdk.Test/Models/ModelTests.cs src/OpenFga.Sdk.Test/OpenFga.Sdk.Test.csproj src/OpenFga.Sdk/Api/OpenFgaApi.cs -src/OpenFga.Sdk/ApiClient/ApiClient.cs -src/OpenFga.Sdk/ApiClient/BaseClient.cs -src/OpenFga.Sdk/ApiClient/OAuth2Client.cs -src/OpenFga.Sdk/ApiClient/RequestBuilder.cs -src/OpenFga.Sdk/ApiClient/RetryHandler.cs -src/OpenFga.Sdk/ApiClient/Utils.cs -src/OpenFga.Sdk/Client/ApiClient.cs -src/OpenFga.Sdk/Client/Client.cs -src/OpenFga.Sdk/Client/ClientConfiguration.cs -src/OpenFga.Sdk/Client/Extensions/LinqExtensions.cs -src/OpenFga.Sdk/Client/Model/AuthorizationModelIdOptions.cs -src/OpenFga.Sdk/Client/Model/ClientBatchCheckOptions.cs -src/OpenFga.Sdk/Client/Model/ClientBatchCheckResponse.cs -src/OpenFga.Sdk/Client/Model/ClientCheckOptions.cs -src/OpenFga.Sdk/Client/Model/ClientCheckRequest.cs -src/OpenFga.Sdk/Client/Model/ClientConsistencyOptions.cs -src/OpenFga.Sdk/Client/Model/ClientCreateStoreOptions.cs -src/OpenFga.Sdk/Client/Model/ClientCreateStoreRequest.cs -src/OpenFga.Sdk/Client/Model/ClientExpandOptions.cs -src/OpenFga.Sdk/Client/Model/ClientExpandRequest.cs -src/OpenFga.Sdk/Client/Model/ClientListObjectsOptions.cs -src/OpenFga.Sdk/Client/Model/ClientListObjectsRequest.cs -src/OpenFga.Sdk/Client/Model/ClientListRelationsOptions.cs -src/OpenFga.Sdk/Client/Model/ClientListRelationsRequest.cs -src/OpenFga.Sdk/Client/Model/ClientListRelationsResponse.cs -src/OpenFga.Sdk/Client/Model/ClientListStoresOptions.cs -src/OpenFga.Sdk/Client/Model/ClientListStoresRequest.cs -src/OpenFga.Sdk/Client/Model/ClientListUsersOptions.cs -src/OpenFga.Sdk/Client/Model/ClientListUsersRequest.cs -src/OpenFga.Sdk/Client/Model/ClientPaginationOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadAssertionsOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelsOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadChangesOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadChangesRequest.cs -src/OpenFga.Sdk/Client/Model/ClientReadOptions.cs -src/OpenFga.Sdk/Client/Model/ClientReadRequest.cs -src/OpenFga.Sdk/Client/Model/ClientRequestOptions.cs -src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithAuthZModelId.cs -src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithStoreId.cs -src/OpenFga.Sdk/Client/Model/ClientTupleKey.cs -src/OpenFga.Sdk/Client/Model/ClientTupleKeyWithoutCondition.cs -src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsOptions.cs -src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsRequest.cs -src/OpenFga.Sdk/Client/Model/ClientWriteAuthorizationModelRequest.cs -src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs -src/OpenFga.Sdk/Client/Model/ClientWriteRequest.cs -src/OpenFga.Sdk/Client/Model/ClientWriteResponse.cs -src/OpenFga.Sdk/Client/Model/ClientWriteStatus.cs -src/OpenFga.Sdk/Client/Model/RetryParams.cs -src/OpenFga.Sdk/Client/Model/StoreIdOptions.cs -src/OpenFga.Sdk/Configuration/Configuration.cs -src/OpenFga.Sdk/Configuration/Credentials.cs -src/OpenFga.Sdk/Configuration/TelemetryConfig.cs -src/OpenFga.Sdk/Exceptions/ApiAuthenticationError.cs -src/OpenFga.Sdk/Exceptions/ApiError.cs -src/OpenFga.Sdk/Exceptions/ApiException.cs -src/OpenFga.Sdk/Exceptions/ApiInternalError.cs -src/OpenFga.Sdk/Exceptions/ApiNotFoundError.cs -src/OpenFga.Sdk/Exceptions/ApiValidationError.cs -src/OpenFga.Sdk/Exceptions/GenericError.cs -src/OpenFga.Sdk/Exceptions/Parsers/ApiErrorParser.cs -src/OpenFga.Sdk/Exceptions/Parsers/RateLimitParser.cs -src/OpenFga.Sdk/Exceptions/RateLimitExceededError.cs -src/OpenFga.Sdk/Exceptions/RequiredParamError.cs -src/OpenFga.Sdk/Exceptions/ValidationError.cs +src/OpenFga.Sdk/Constants/FgaConstants.cs src/OpenFga.Sdk/Model/AbortedMessageResponse.cs src/OpenFga.Sdk/Model/AbstractOpenAPISchema.cs src/OpenFga.Sdk/Model/Any.cs @@ -216,7 +132,6 @@ src/OpenFga.Sdk/Model/ForbiddenResponse.cs src/OpenFga.Sdk/Model/GetStoreResponse.cs src/OpenFga.Sdk/Model/InternalErrorCode.cs src/OpenFga.Sdk/Model/InternalErrorMessageResponse.cs -src/OpenFga.Sdk/Model/JsonStringEnumMemberConverter.cs src/OpenFga.Sdk/Model/Leaf.cs src/OpenFga.Sdk/Model/ListObjectsRequest.cs src/OpenFga.Sdk/Model/ListObjectsResponse.cs @@ -272,10 +187,4 @@ src/OpenFga.Sdk/Model/WriteAuthorizationModelResponse.cs src/OpenFga.Sdk/Model/WriteRequest.cs src/OpenFga.Sdk/Model/WriteRequestDeletes.cs src/OpenFga.Sdk/Model/WriteRequestWrites.cs -src/OpenFga.Sdk/OpenFga.Sdk.csproj -src/OpenFga.Sdk/Properties/AssemblyInfo.cs -src/OpenFga.Sdk/Telemetry/Attributes.cs -src/OpenFga.Sdk/Telemetry/Counters.cs -src/OpenFga.Sdk/Telemetry/Histograms.cs -src/OpenFga.Sdk/Telemetry/Meters.cs -src/OpenFga.Sdk/Telemetry/Metrics.cs +src/OpenFga.Sdk/OpenFga.Sdk.csproj \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47cff816..58028381 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,17 +23,23 @@ By participating and contributing to this project, you are expected to uphold ou ### Making Changes -When contributing to a repository, the first step is to open an issue on [sdk-generator](https://github.com/openfga/sdk-generator) to discuss the change you wish to make before making them. +When contributing to a repository, the first step is to open [an issue](https://github.com/openfga/dotnet-sdk/issues) to discuss the change you wish to make before making them. ### Opening Issues Before you submit a new issue please make sure to search all open and closed issues. It is possible your feature request/issue has already been answered. Make sure to also check the [OpenFGA discussions](https://github.com/orgs/openfga/discussions). -That repo includes an issue template that will walk through all the places to check before submitting your issue here. Please follow the instructions there to make sure this is not a duplicate issue and that we have everything we need to research and reproduce this problem. +The repo includes an issue template that will walk through all the places to check before submitting your issue here. Please follow the instructions there to make sure this is not a duplicate issue and that we have everything we need to research and reproduce this problem. + +If you have found a bug or if you have a feature request, please report them in the [repo issues](https://github.com/openfga/dotnet-sdk/issues). Cross-SDK bugs and feature requests can be additionally reported in the [sdk-generator repo](https://github.com/openfga/sdk-generator/issues) issues section, where the individual SDK issue is then linked. + +**Please do not report security vulnerabilities on the public GitHub issue tracker.** ### Submitting Pull Requests -While we accept Pull Requests on this repository, the SDKs are autogenerated so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well. +Feel free to submit a Pull Request against this repository. Please make sure to follow the existing code style and include tests where applicable. + +Some files in this repository are autogenerated. These files have a comment at the top indicating that they are autogenerated and should not be modified directly - the files are usually identified by a header marking them as such, or by their inclusion in [`.openapi-generator/FILES`](./.openapi-generator/FILES). Changes to these files should be made in the [sdk-generator](https://github.com/openfga/sdk-generator) repository in tandem, so please consider additionally submitting your Pull Requests to the [sdk-generator](https://github.com/openfga/sdk-generator) and linking the two PRs together and to the corresponding issue. This will greatly assist the OpenFGA team in being able to give timely reviews as well as deploying fixes and updates to our other SDKs as well. ## Getting in touch diff --git a/README.md b/README.md index 1efb1e44..30d1f627 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This is an autogenerated SDK for OpenFGA. It provides a wrapper around the [Open - [Installation](#installation) - [Getting Started](#getting-started) - [Initializing the API Client](#initializing-the-api-client) + - [Custom Headers](#custom-headers) - [Get your Store ID](#get-your-store-id) - [Calling the API](#calling-the-api) - [Stores](#stores) @@ -1041,13 +1042,7 @@ This SDK supports producing metrics that can be consumed as part of an [OpenTele ## Contributing -### Issues - -If you have found a bug or if you have a feature request, please report them on the [sdk-generator repo](https://github.com/openfga/sdk-generator/issues) issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. - -### Pull Requests - -All changes made to this repo will be overwritten on the next generation, so we kindly ask that you send all pull requests related to the SDKs to the [sdk-generator repo](https://github.com/openfga/sdk-generator) instead. +See [CONTRIBUTING](./CONTRIBUTING.md) for details. ## Author diff --git a/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs b/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs index 7c45102a..8088dc57 100644 --- a/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs +++ b/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs @@ -1,15 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - using Moq; using Moq.Protected; using OpenFga.Sdk.Api; @@ -2845,10 +2833,8 @@ public async Task RetryMultipleRetriesWithDifferentDelaysTimingVerification() { var delay1 = attemptTimes[1] - attemptTimes[0]; var delay2 = attemptTimes[2] - attemptTimes[1]; - Assert.True(delay1 >= 1000, $"First retry delay should be ~1000ms, got {delay1}ms"); - Assert.True(delay1 < 1300, $"First retry delay should be ~1000ms, got {delay1}ms"); - Assert.True(delay2 >= 2000, $"Second retry delay should be ~2000ms, got {delay2}ms"); - Assert.True(delay2 < 2300, $"Second retry delay should be ~2000ms, got {delay2}ms"); + Assert.InRange(delay1, 900, 1100); + Assert.InRange(delay2, 1900, 2100); } [Fact] diff --git a/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs b/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs index 6273132e..6b9bf4b9 100644 --- a/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs +++ b/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using Moq; using Moq.Protected; using OpenFga.Sdk.ApiClient; diff --git a/src/OpenFga.Sdk.Test/Models/Client/ClientBatchCheckResponseTest.cs b/src/OpenFga.Sdk.Test/Models/Client/ClientBatchCheckResponseTest.cs index d36beb10..185ffe8a 100644 --- a/src/OpenFga.Sdk.Test/Models/Client/ClientBatchCheckResponseTest.cs +++ b/src/OpenFga.Sdk.Test/Models/Client/ClientBatchCheckResponseTest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Client.Model; using System.Collections.Generic; using Xunit; diff --git a/src/OpenFga.Sdk.Test/Models/ModelTests.cs b/src/OpenFga.Sdk.Test/Models/ModelTests.cs index 51d19470..dac57bb6 100644 --- a/src/OpenFga.Sdk.Test/Models/ModelTests.cs +++ b/src/OpenFga.Sdk.Test/Models/ModelTests.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/ApiClient/ApiClient.cs b/src/OpenFga.Sdk/ApiClient/ApiClient.cs index 343a4f7a..a0f2d03d 100644 --- a/src/OpenFga.Sdk/ApiClient/ApiClient.cs +++ b/src/OpenFga.Sdk/ApiClient/ApiClient.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Configuration; diff --git a/src/OpenFga.Sdk/ApiClient/BaseClient.cs b/src/OpenFga.Sdk/ApiClient/BaseClient.cs index 691a16ae..ad90aca0 100644 --- a/src/OpenFga.Sdk/ApiClient/BaseClient.cs +++ b/src/OpenFga.Sdk/ApiClient/BaseClient.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/ApiClient/OAuth2Client.cs b/src/OpenFga.Sdk/ApiClient/OAuth2Client.cs index d830e431..547cfe71 100644 --- a/src/OpenFga.Sdk/ApiClient/OAuth2Client.cs +++ b/src/OpenFga.Sdk/ApiClient/OAuth2Client.cs @@ -1,18 +1,6 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Configuration; +using OpenFga.Sdk.Constants; using OpenFga.Sdk.Exceptions; using OpenFga.Sdk.Telemetry; using System; @@ -30,10 +18,10 @@ namespace OpenFga.Sdk.ApiClient; /// OAuth2 Client to exchange the credentials for an access token using the client credentials flow /// public class OAuth2Client { - private const int TOKEN_EXPIRY_BUFFER_THRESHOLD_IN_SEC = 300; + private const int TOKEN_EXPIRY_BUFFER_THRESHOLD_IN_SEC = FgaConstants.TokenExpiryThresholdBufferInSec; private const int - TOKEN_EXPIRY_JITTER_IN_SEC = 300; // We add some jitter so that token refreshes are less likely to collide + TOKEN_EXPIRY_JITTER_IN_SEC = FgaConstants.TokenExpiryJitterInSec; // We add some jitter so that token refreshes are less likely to collide private static readonly Random _random = new(); private readonly Metrics metrics; diff --git a/src/OpenFga.Sdk/ApiClient/RequestBuilder.cs b/src/OpenFga.Sdk/ApiClient/RequestBuilder.cs index b36aeebd..02d70374 100644 --- a/src/OpenFga.Sdk/ApiClient/RequestBuilder.cs +++ b/src/OpenFga.Sdk/ApiClient/RequestBuilder.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/ApiClient/Utils.cs b/src/OpenFga.Sdk/ApiClient/Utils.cs index 39e9626b..dc1e20d2 100644 --- a/src/OpenFga.Sdk/ApiClient/Utils.cs +++ b/src/OpenFga.Sdk/ApiClient/Utils.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.Linq; diff --git a/src/OpenFga.Sdk/Client/Client.cs b/src/OpenFga.Sdk/Client/Client.cs index f5738208..272bf706 100644 --- a/src/OpenFga.Sdk/Client/Client.cs +++ b/src/OpenFga.Sdk/Client/Client.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -22,6 +9,7 @@ using OpenFga.Sdk.Api; using OpenFga.Sdk.ApiClient; using OpenFga.Sdk.Client.Model; +using OpenFga.Sdk.Constants; #if NETSTANDARD2_0 || NET48 using OpenFga.Sdk.Client.Extensions; #endif @@ -33,10 +21,6 @@ namespace OpenFga.Sdk.Client; public class OpenFgaClient : IDisposable { private readonly ClientConfiguration _configuration; protected OpenFgaApi api; - private string CLIENT_BULK_REQUEST_ID_HEADER = "X-OpenFGA-Client-Bulk-Request-Id"; - private string CLIENT_METHOD_HEADER = "X-OpenFGA-Client-Method"; - - private readonly int DEFAULT_MAX_METHOD_PARALLEL_REQS = 10; public OpenFgaClient( ClientConfiguration configuration, @@ -359,7 +343,7 @@ public async Task Write(ClientWriteRequest body, IClientWri options?.Transaction?.MaxPerChunk ?? 1; // 1 has to be the default otherwise the chunks will be sent in transactions var maxParallelReqs = - options?.Transaction?.MaxParallelRequests ?? DEFAULT_MAX_METHOD_PARALLEL_REQS; + options?.Transaction?.MaxParallelRequests ?? FgaConstants.ClientMaxMethodParallelRequests; var authorizationModelId = GetAuthorizationModelId(options); if (options?.Transaction?.Disable != true) { @@ -470,7 +454,7 @@ public async Task BatchCheck(List(); - var maxParallelReqs = options?.MaxParallelRequests ?? DEFAULT_MAX_METHOD_PARALLEL_REQS; + var maxParallelReqs = options?.MaxParallelRequests ?? FgaConstants.ClientMaxMethodParallelRequests; await ProcessCheckRequestsAsync(body, responses, options, maxParallelReqs, cancellationToken); diff --git a/src/OpenFga.Sdk/Client/ClientConfiguration.cs b/src/OpenFga.Sdk/Client/ClientConfiguration.cs index 2a91e4f9..bdb8559e 100644 --- a/src/OpenFga.Sdk/Client/ClientConfiguration.cs +++ b/src/OpenFga.Sdk/Client/ClientConfiguration.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Exceptions; using System; diff --git a/src/OpenFga.Sdk/Client/Extensions/LinqExtensions.cs b/src/OpenFga.Sdk/Client/Extensions/LinqExtensions.cs index dd03ceaa..5a3ae25a 100644 --- a/src/OpenFga.Sdk/Client/Extensions/LinqExtensions.cs +++ b/src/OpenFga.Sdk/Client/Extensions/LinqExtensions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.Linq; diff --git a/src/OpenFga.Sdk/Client/Model/AuthorizationModelIdOptions.cs b/src/OpenFga.Sdk/Client/Model/AuthorizationModelIdOptions.cs index 5db86a91..45939846 100644 --- a/src/OpenFga.Sdk/Client/Model/AuthorizationModelIdOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/AuthorizationModelIdOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; public interface AuthorizationModelIdOptions { diff --git a/src/OpenFga.Sdk/Client/Model/ClientBatchCheckOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientBatchCheckOptions.cs index 91547b15..09b65a36 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientBatchCheckOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientBatchCheckOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientBatchCheckResponse.cs b/src/OpenFga.Sdk/Client/Model/ClientBatchCheckResponse.cs index 3d45bab7..e3e452b7 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientBatchCheckResponse.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientBatchCheckResponse.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientCheckOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientCheckOptions.cs index 7a1e9488..373c0b47 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientCheckOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientCheckOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientCheckRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientCheckRequest.cs index 6839019f..52765aa0 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientCheckRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientCheckRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientConsistencyOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientConsistencyOptions.cs index 085069b9..6f485a66 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientConsistencyOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientConsistencyOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientCreateStoreOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientCreateStoreOptions.cs index 52db0132..c84811e1 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientCreateStoreOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientCreateStoreOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientCreateStoreRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientCreateStoreRequest.cs index 7c991440..7695a1c9 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientCreateStoreRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientCreateStoreRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientExpandOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientExpandOptions.cs index 98c26f70..985f1886 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientExpandOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientExpandOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientExpandRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientExpandRequest.cs index e49f2316..7ed42432 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientExpandRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientExpandRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListObjectsOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientListObjectsOptions.cs index 6f32c1a6..fd3ea35a 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListObjectsOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListObjectsOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListObjectsRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientListObjectsRequest.cs index 2e7f88ed..dc29d8e4 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListObjectsRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListObjectsRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListRelationsOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientListRelationsOptions.cs index dbb287c0..d5663899 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListRelationsOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListRelationsOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListRelationsRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientListRelationsRequest.cs index 7c95302c..6979e902 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListRelationsRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListRelationsRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListRelationsResponse.cs b/src/OpenFga.Sdk/Client/Model/ClientListRelationsResponse.cs index a0aa5729..d4c25cf0 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListRelationsResponse.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListRelationsResponse.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListStoresOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientListStoresOptions.cs index efa1f3eb..46751435 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListStoresOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListStoresOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListStoresRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientListStoresRequest.cs index fe99b9e4..f1cf03d8 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListStoresRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListStoresRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListUsersOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientListUsersOptions.cs index 877be757..9db34975 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListUsersOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListUsersOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientListUsersRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientListUsersRequest.cs index 561e795d..e5e4a5f4 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientListUsersRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientListUsersRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientPaginationOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientPaginationOptions.cs index 60c44732..8808ca5c 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientPaginationOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientPaginationOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; /// diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadAssertionsOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientReadAssertionsOptions.cs index ba6ebcf0..7628be90 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadAssertionsOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadAssertionsOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelOptions.cs index b901cc31..9f2c2e4e 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelsOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelsOptions.cs index bf1b814a..27668a3c 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelsOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadAuthorizaionModelsOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadChangesOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientReadChangesOptions.cs index fbff5671..e315635b 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadChangesOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadChangesOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadChangesRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientReadChangesRequest.cs index c226b935..cb257ccb 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadChangesRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadChangesRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientReadOptions.cs index 0e82a410..a638d003 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientReadRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientReadRequest.cs index 3fa88865..1aea9a1f 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientReadRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientReadRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientRequestOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientRequestOptions.cs index 1930a907..18e4f3e8 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientRequestOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientRequestOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithAuthZModelId.cs b/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithAuthZModelId.cs index 4d1da2ec..4d5a875c 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithAuthZModelId.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithAuthZModelId.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; /// diff --git a/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithStoreId.cs b/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithStoreId.cs index 279a9e4b..3364c552 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithStoreId.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientRequestOptsWithStoreId.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; /// diff --git a/src/OpenFga.Sdk/Client/Model/ClientTupleKey.cs b/src/OpenFga.Sdk/Client/Model/ClientTupleKey.cs index d6f846c1..a34de1ed 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientTupleKey.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientTupleKey.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientTupleKeyWithoutCondition.cs b/src/OpenFga.Sdk/Client/Model/ClientTupleKeyWithoutCondition.cs index 82776284..8ad117dc 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientTupleKeyWithoutCondition.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientTupleKeyWithoutCondition.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsOptions.cs index 5ebdb39d..45128811 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsRequest.cs index efc05087..972e8672 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteAssertionsRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteAuthorizationModelRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteAuthorizationModelRequest.cs index fe81f7bc..79f1058a 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteAuthorizationModelRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteAuthorizationModelRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; namespace OpenFga.Sdk.Client.Model; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs index 5119a57d..d8e0fc6d 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteRequest.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteRequest.cs index df578336..249b36e4 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteRequest.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteRequest.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteResponse.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteResponse.cs index ffacf91e..400b2534 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteResponse.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteResponse.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Model; using System; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Client/Model/ClientWriteStatus.cs b/src/OpenFga.Sdk/Client/Model/ClientWriteStatus.cs index 7a7b994e..19ab613a 100644 --- a/src/OpenFga.Sdk/Client/Model/ClientWriteStatus.cs +++ b/src/OpenFga.Sdk/Client/Model/ClientWriteStatus.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Runtime.Serialization; using System.Text.Json.Serialization; diff --git a/src/OpenFga.Sdk/Client/Model/RetryParams.cs b/src/OpenFga.Sdk/Client/Model/RetryParams.cs index 64c3902c..e3fa7bab 100644 --- a/src/OpenFga.Sdk/Client/Model/RetryParams.cs +++ b/src/OpenFga.Sdk/Client/Model/RetryParams.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; /// diff --git a/src/OpenFga.Sdk/Client/Model/StoreIdOptions.cs b/src/OpenFga.Sdk/Client/Model/StoreIdOptions.cs index a5baf331..7b5076c7 100644 --- a/src/OpenFga.Sdk/Client/Model/StoreIdOptions.cs +++ b/src/OpenFga.Sdk/Client/Model/StoreIdOptions.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Client.Model; public interface StoreIdOptions { diff --git a/src/OpenFga.Sdk/Configuration/Configuration.cs b/src/OpenFga.Sdk/Configuration/Configuration.cs index e058f390..7146fe4e 100644 --- a/src/OpenFga.Sdk/Configuration/Configuration.cs +++ b/src/OpenFga.Sdk/Configuration/Configuration.cs @@ -1,16 +1,4 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - +using OpenFga.Sdk.Constants; using OpenFga.Sdk.Exceptions; using System; using System.Collections.Generic; @@ -31,7 +19,7 @@ public Configuration() { DefaultHeaders ??= new Dictionary(); if (!DefaultHeaders.ContainsKey("User-Agent")) { - DefaultHeaders.Add("User-Agent", DefaultUserAgent); + DefaultHeaders.Add("User-Agent", FgaConstants.UserAgent); } } @@ -117,8 +105,8 @@ public void EnsureValid() { $"Configuration.ApiUrl ({ApiUrl ?? BasePath}) does not form a valid URI ({BasePath})"); } - if (MaxRetry > 15) { - throw new FgaValidationError("Configuration.MaxRetry exceeds maximum allowed limit of 15"); + if (MaxRetry > FgaConstants.RetryMaxAllowedNumber) { + throw new FgaValidationError($"Configuration.MaxRetry exceeds maximum allowed limit of {FgaConstants.RetryMaxAllowedNumber}"); } // Validate that DefaultHeaders don't contain reserved headers @@ -136,9 +124,9 @@ public void EnsureValid() { /// Version of the package. /// /// Version of the package. - public const string Version = "0.8.0"; + public const string Version = FgaConstants.SdkVersion; - private const string DefaultUserAgent = "openfga-sdk dotnet/0.8.0"; + private const string DefaultUserAgent = FgaConstants.UserAgent; #endregion Constants @@ -211,13 +199,13 @@ public string BasePath { /// Max number of times to retry after a request is rate limited /// /// MaxRetry - public int MaxRetry { get; set; } = 3; + public int MaxRetry { get; set; } = FgaConstants.DefaultMaxRetry; /// /// Minimum time in ms to wait before retrying /// /// MinWaitInMs - public int MinWaitInMs { get; set; } = 100; + public int MinWaitInMs { get; set; } = FgaConstants.DefaultMinWaitInMs; /// /// Gets or sets the telemetry configuration. diff --git a/src/OpenFga.Sdk/Configuration/TelemetryConfig.cs b/src/OpenFga.Sdk/Configuration/TelemetryConfig.cs index 60cfaeca..16e0bfd8 100644 --- a/src/OpenFga.Sdk/Configuration/TelemetryConfig.cs +++ b/src/OpenFga.Sdk/Configuration/TelemetryConfig.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions; using OpenFga.Sdk.Telemetry; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Constants/FgaConstants.cs b/src/OpenFga.Sdk/Constants/FgaConstants.cs new file mode 100644 index 00000000..b096991e --- /dev/null +++ b/src/OpenFga.Sdk/Constants/FgaConstants.cs @@ -0,0 +1,156 @@ +// +// OpenFGA/.NET SDK for OpenFGA +// +// API version: 1.x +// Website: https://openfga.dev +// Documentation: https://openfga.dev/docs +// Support: https://openfga.dev/community +// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) +// +// NOTE: This file was auto generated. DO NOT EDIT. +// + + +namespace OpenFga.Sdk.Constants; + +/// +/// Centralized constants for the OpenFGA .NET SDK. +/// +public static class FgaConstants { + /// + /// Version of the OpenFGA .NET SDK. + /// + public const string SdkVersion = "0.8.0"; + + /// + /// User agent used in HTTP requests. + /// + public const string UserAgent = "openfga-sdk dotnet/0.8.0"; + + /// + /// Example API domain for documentation/tests. + /// + public static readonly string SampleBaseDomain = "fga.example"; + + /// + /// API URL used for tests. + /// + public static readonly string TestApiUrl = "https://api." + SampleBaseDomain; + + /// + /// API Token Issuer URL used for tests. + /// + public static readonly string TestIssuerUrl = "https://issuer." + SampleBaseDomain; + + /// + /// Default API URL. + /// + public static readonly string DefaultApiUrl = "http://localhost:8080"; + + // Retry configuration + + /// + /// Maximum allowed number of retries for HTTP requests. + /// + public const int RetryMaxAllowedNumber = 15; + + /// + /// Default maximum number of retries for HTTP requests. + /// + public const int DefaultMaxRetry = 3; + + /// + /// Default minimum wait time between retries in milliseconds. + /// + public const int DefaultMinWaitInMs = 100; + + /// + /// Maximum backoff time in seconds. + /// + public const int MaxBackoffTimeInSec = 120; + + /// + /// Maximum allowable duration for retry headers in seconds. + /// + public const int RetryHeaderMaxAllowableDurationInSec = 1800; + + /// + /// Standard HTTP header for retry-after. + /// + public static readonly string RetryAfterHeaderName = "Retry-After"; + + /// + /// Rate limit reset header name. + /// + public static readonly string RateLimitResetHeaderName = "X-RateLimit-Reset"; + + /// + /// Alternative rate limit reset header name. + /// + public static readonly string RateLimitResetAltHeaderName = "X-Rate-Limit-Reset"; + + // Client methods + + /// + /// Maximum number of parallel requests for a single method. + /// + public const int ClientMaxMethodParallelRequests = 10; + + /// + /// Maximum batch size for batch requests. + /// + public const int ClientMaxBatchSize = 50; + + /// + /// Header used to identify the client method. + /// + public static readonly string ClientMethodHeader = "X-OpenFGA-Client-Method"; + + /// + /// Header used to identify bulk requests. + /// + public static readonly string ClientBulkRequestIdHeader = "X-OpenFGA-Client-Bulk-Request-Id"; + + // Connection options + + /// + /// Default timeout for HTTP requests in milliseconds. + /// + public const int DefaultRequestTimeoutInMs = 10000; + + /// + /// Default connection timeout in milliseconds. + /// + public const int DefaultConnectionTimeoutInMs = 10000; + + // Token management + + /// + /// Buffer time in seconds before token expiry to consider it expired. + /// + public const int TokenExpiryThresholdBufferInSec = 300; + + /// + /// Jitter time in seconds to add randomness to token expiry checks. + /// + public const int TokenExpiryJitterInSec = 300; + + // FGA Response Headers + + /// + /// Response header name for query duration in milliseconds. + /// + public static readonly string QueryDurationHeaderName = "fga-query-duration-ms"; + + // .NET Specific constants + + /// + /// Prime number used as a base in hash code calculations. + /// + public const int HashCodeBasePrimeNumber = 9661; + + /// + /// Prime number used as a multiplier in hash code calculations. + /// + public const int HashCodeMultiplierPrimeNumber = 9923; +} \ No newline at end of file diff --git a/src/OpenFga.Sdk/Exceptions/ApiAuthenticationError.cs b/src/OpenFga.Sdk/Exceptions/ApiAuthenticationError.cs index a2ee381d..47ad086b 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiAuthenticationError.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiAuthenticationError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System; using System.Net; diff --git a/src/OpenFga.Sdk/Exceptions/ApiError.cs b/src/OpenFga.Sdk/Exceptions/ApiError.cs index 6660f7ee..18004b44 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiError.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System; using System.Net; diff --git a/src/OpenFga.Sdk/Exceptions/ApiException.cs b/src/OpenFga.Sdk/Exceptions/ApiException.cs index 66debc8d..c04ea106 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiException.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiException.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Net; using System.Net.Http; diff --git a/src/OpenFga.Sdk/Exceptions/ApiInternalError.cs b/src/OpenFga.Sdk/Exceptions/ApiInternalError.cs index c1135ba2..1d405c31 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiInternalError.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiInternalError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/OpenFga.Sdk/Exceptions/ApiNotFoundError.cs b/src/OpenFga.Sdk/Exceptions/ApiNotFoundError.cs index 8c42fa17..b64d07c3 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiNotFoundError.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiNotFoundError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/OpenFga.Sdk/Exceptions/ApiValidationError.cs b/src/OpenFga.Sdk/Exceptions/ApiValidationError.cs index 0feac70f..29d66924 100644 --- a/src/OpenFga.Sdk/Exceptions/ApiValidationError.cs +++ b/src/OpenFga.Sdk/Exceptions/ApiValidationError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/OpenFga.Sdk/Exceptions/GenericError.cs b/src/OpenFga.Sdk/Exceptions/GenericError.cs index 5ad802ed..db08f7d6 100644 --- a/src/OpenFga.Sdk/Exceptions/GenericError.cs +++ b/src/OpenFga.Sdk/Exceptions/GenericError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; namespace OpenFga.Sdk.Exceptions; diff --git a/src/OpenFga.Sdk/Exceptions/Parsers/ApiErrorParser.cs b/src/OpenFga.Sdk/Exceptions/Parsers/ApiErrorParser.cs index 5d32ee63..6a9af08a 100644 --- a/src/OpenFga.Sdk/Exceptions/Parsers/ApiErrorParser.cs +++ b/src/OpenFga.Sdk/Exceptions/Parsers/ApiErrorParser.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Net.Http; using System.Text.Json; diff --git a/src/OpenFga.Sdk/Exceptions/Parsers/RateLimitParser.cs b/src/OpenFga.Sdk/Exceptions/Parsers/RateLimitParser.cs index 168f6686..1572abd7 100644 --- a/src/OpenFga.Sdk/Exceptions/Parsers/RateLimitParser.cs +++ b/src/OpenFga.Sdk/Exceptions/Parsers/RateLimitParser.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; using System.Linq; using System.Net.Http; diff --git a/src/OpenFga.Sdk/Exceptions/RateLimitExceededError.cs b/src/OpenFga.Sdk/Exceptions/RateLimitExceededError.cs index 63ca874f..4ecbb50d 100644 --- a/src/OpenFga.Sdk/Exceptions/RateLimitExceededError.cs +++ b/src/OpenFga.Sdk/Exceptions/RateLimitExceededError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.Exceptions.Parsers; using System; using System.Net.Http; diff --git a/src/OpenFga.Sdk/Exceptions/RequiredParamError.cs b/src/OpenFga.Sdk/Exceptions/RequiredParamError.cs index ef786fee..558d84a1 100644 --- a/src/OpenFga.Sdk/Exceptions/RequiredParamError.cs +++ b/src/OpenFga.Sdk/Exceptions/RequiredParamError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - namespace OpenFga.Sdk.Exceptions; /// diff --git a/src/OpenFga.Sdk/Exceptions/ValidationError.cs b/src/OpenFga.Sdk/Exceptions/ValidationError.cs index 68540030..6fbfd139 100644 --- a/src/OpenFga.Sdk/Exceptions/ValidationError.cs +++ b/src/OpenFga.Sdk/Exceptions/ValidationError.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System; namespace OpenFga.Sdk.Exceptions; diff --git a/src/OpenFga.Sdk/Model/AbortedMessageResponse.cs b/src/OpenFga.Sdk/Model/AbortedMessageResponse.cs index f091ea3b..8c08556b 100644 --- a/src/OpenFga.Sdk/Model/AbortedMessageResponse.cs +++ b/src/OpenFga.Sdk/Model/AbortedMessageResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// AbortedMessageResponse @@ -123,15 +123,15 @@ public bool Equals(AbortedMessageResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Code != null) { - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); } if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Any.cs b/src/OpenFga.Sdk/Model/Any.cs index 2b70ec9c..479c7749 100644 --- a/src/OpenFga.Sdk/Model/Any.cs +++ b/src/OpenFga.Sdk/Model/Any.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Any @@ -108,12 +108,12 @@ public bool Equals(Any input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Assertion.cs b/src/OpenFga.Sdk/Model/Assertion.cs index f20c46b3..83e3ed0c 100644 --- a/src/OpenFga.Sdk/Model/Assertion.cs +++ b/src/OpenFga.Sdk/Model/Assertion.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Assertion @@ -158,19 +158,19 @@ public bool Equals(Assertion input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Expectation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Expectation.GetHashCode(); if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/AssertionTupleKey.cs b/src/OpenFga.Sdk/Model/AssertionTupleKey.cs index b6052a42..4b0f980e 100644 --- a/src/OpenFga.Sdk/Model/AssertionTupleKey.cs +++ b/src/OpenFga.Sdk/Model/AssertionTupleKey.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// AssertionTupleKey @@ -150,18 +150,18 @@ public bool Equals(AssertionTupleKey input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/AuthErrorCode.cs b/src/OpenFga.Sdk/Model/AuthErrorCode.cs index 599efa4d..f9dd1753 100644 --- a/src/OpenFga.Sdk/Model/AuthErrorCode.cs +++ b/src/OpenFga.Sdk/Model/AuthErrorCode.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines AuthErrorCode diff --git a/src/OpenFga.Sdk/Model/AuthorizationModel.cs b/src/OpenFga.Sdk/Model/AuthorizationModel.cs index 3cb9dac9..72a224bd 100644 --- a/src/OpenFga.Sdk/Model/AuthorizationModel.cs +++ b/src/OpenFga.Sdk/Model/AuthorizationModel.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// AuthorizationModel @@ -167,21 +167,21 @@ public bool Equals(AuthorizationModel input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.SchemaVersion != null) { - hashCode = (hashCode * 9923) + this.SchemaVersion.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.SchemaVersion.GetHashCode(); } if (this.TypeDefinitions != null) { - hashCode = (hashCode * 9923) + this.TypeDefinitions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TypeDefinitions.GetHashCode(); } if (this.Conditions != null) { - hashCode = (hashCode * 9923) + this.Conditions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Conditions.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/BatchCheckItem.cs b/src/OpenFga.Sdk/Model/BatchCheckItem.cs index 77d82221..2bb21ffd 100644 --- a/src/OpenFga.Sdk/Model/BatchCheckItem.cs +++ b/src/OpenFga.Sdk/Model/BatchCheckItem.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// BatchCheckItem @@ -162,21 +162,21 @@ public bool Equals(BatchCheckItem input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } if (this.CorrelationId != null) { - hashCode = (hashCode * 9923) + this.CorrelationId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.CorrelationId.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/BatchCheckRequest.cs b/src/OpenFga.Sdk/Model/BatchCheckRequest.cs index 7eef96be..87d4611f 100644 --- a/src/OpenFga.Sdk/Model/BatchCheckRequest.cs +++ b/src/OpenFga.Sdk/Model/BatchCheckRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// BatchCheckRequest @@ -141,16 +141,16 @@ public bool Equals(BatchCheckRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Checks != null) { - hashCode = (hashCode * 9923) + this.Checks.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Checks.GetHashCode(); } if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/BatchCheckResponse.cs b/src/OpenFga.Sdk/Model/BatchCheckResponse.cs index 32e98310..e23ff66e 100644 --- a/src/OpenFga.Sdk/Model/BatchCheckResponse.cs +++ b/src/OpenFga.Sdk/Model/BatchCheckResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// BatchCheckResponse @@ -110,12 +110,12 @@ public bool Equals(BatchCheckResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Result != null) { - hashCode = (hashCode * 9923) + this.Result.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Result.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/BatchCheckSingleResult.cs b/src/OpenFga.Sdk/Model/BatchCheckSingleResult.cs index b68bf620..4de94373 100644 --- a/src/OpenFga.Sdk/Model/BatchCheckSingleResult.cs +++ b/src/OpenFga.Sdk/Model/BatchCheckSingleResult.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// BatchCheckSingleResult @@ -122,13 +122,13 @@ public bool Equals(BatchCheckSingleResult input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Allowed.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Allowed.GetHashCode(); if (this.Error != null) { - hashCode = (hashCode * 9923) + this.Error.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Error.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CheckError.cs b/src/OpenFga.Sdk/Model/CheckError.cs index 772dc650..6508dfc5 100644 --- a/src/OpenFga.Sdk/Model/CheckError.cs +++ b/src/OpenFga.Sdk/Model/CheckError.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CheckError @@ -134,14 +134,14 @@ public bool Equals(CheckError input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.InputError.GetHashCode(); - hashCode = (hashCode * 9923) + this.InternalError.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.InputError.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.InternalError.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CheckRequest.cs b/src/OpenFga.Sdk/Model/CheckRequest.cs index da01bdf6..cf12e548 100644 --- a/src/OpenFga.Sdk/Model/CheckRequest.cs +++ b/src/OpenFga.Sdk/Model/CheckRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CheckRequest @@ -191,23 +191,23 @@ public bool Equals(CheckRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Trace.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Trace.GetHashCode(); if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CheckRequestTupleKey.cs b/src/OpenFga.Sdk/Model/CheckRequestTupleKey.cs index 989066a2..da9bc74a 100644 --- a/src/OpenFga.Sdk/Model/CheckRequestTupleKey.cs +++ b/src/OpenFga.Sdk/Model/CheckRequestTupleKey.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CheckRequestTupleKey @@ -150,18 +150,18 @@ public bool Equals(CheckRequestTupleKey input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CheckResponse.cs b/src/OpenFga.Sdk/Model/CheckResponse.cs index 48ec8943..b6ffcae0 100644 --- a/src/OpenFga.Sdk/Model/CheckResponse.cs +++ b/src/OpenFga.Sdk/Model/CheckResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CheckResponse @@ -123,13 +123,13 @@ public bool Equals(CheckResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Allowed.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Allowed.GetHashCode(); if (this.Resolution != null) { - hashCode = (hashCode * 9923) + this.Resolution.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Resolution.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Computed.cs b/src/OpenFga.Sdk/Model/Computed.cs index 2c7c9a27..3c3984e0 100644 --- a/src/OpenFga.Sdk/Model/Computed.cs +++ b/src/OpenFga.Sdk/Model/Computed.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Computed @@ -112,12 +112,12 @@ public bool Equals(Computed input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Userset != null) { - hashCode = (hashCode * 9923) + this.Userset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Userset.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Condition.cs b/src/OpenFga.Sdk/Model/Condition.cs index 87324bc9..ca886a2e 100644 --- a/src/OpenFga.Sdk/Model/Condition.cs +++ b/src/OpenFga.Sdk/Model/Condition.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Condition @@ -164,21 +164,21 @@ public bool Equals(Condition input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.Expression != null) { - hashCode = (hashCode * 9923) + this.Expression.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Expression.GetHashCode(); } if (this.Parameters != null) { - hashCode = (hashCode * 9923) + this.Parameters.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Parameters.GetHashCode(); } if (this.Metadata != null) { - hashCode = (hashCode * 9923) + this.Metadata.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Metadata.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ConditionMetadata.cs b/src/OpenFga.Sdk/Model/ConditionMetadata.cs index d0ef7ac7..7a85886f 100644 --- a/src/OpenFga.Sdk/Model/ConditionMetadata.cs +++ b/src/OpenFga.Sdk/Model/ConditionMetadata.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ConditionMetadata @@ -123,15 +123,15 @@ public bool Equals(ConditionMetadata input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Module != null) { - hashCode = (hashCode * 9923) + this.Module.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Module.GetHashCode(); } if (this.SourceInfo != null) { - hashCode = (hashCode * 9923) + this.SourceInfo.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.SourceInfo.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ConditionParamTypeRef.cs b/src/OpenFga.Sdk/Model/ConditionParamTypeRef.cs index 759f55ea..7667cd70 100644 --- a/src/OpenFga.Sdk/Model/ConditionParamTypeRef.cs +++ b/src/OpenFga.Sdk/Model/ConditionParamTypeRef.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ConditionParamTypeRef @@ -122,13 +122,13 @@ public bool Equals(ConditionParamTypeRef input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.TypeName.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TypeName.GetHashCode(); if (this.GenericTypes != null) { - hashCode = (hashCode * 9923) + this.GenericTypes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.GenericTypes.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ConsistencyPreference.cs b/src/OpenFga.Sdk/Model/ConsistencyPreference.cs index 1228bb61..559e218d 100644 --- a/src/OpenFga.Sdk/Model/ConsistencyPreference.cs +++ b/src/OpenFga.Sdk/Model/ConsistencyPreference.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Controls the consistency preferences when calling the query APIs. - UNSPECIFIED: Default if not set. Behavior will be the same as MINIMIZE_LATENCY. - MINIMIZE_LATENCY: Minimize latency at the potential expense of lower consistency. - HIGHER_CONSISTENCY: Prefer higher consistency, at the potential expense of increased latency. diff --git a/src/OpenFga.Sdk/Model/ContextualTupleKeys.cs b/src/OpenFga.Sdk/Model/ContextualTupleKeys.cs index 68829fab..9ade41a2 100644 --- a/src/OpenFga.Sdk/Model/ContextualTupleKeys.cs +++ b/src/OpenFga.Sdk/Model/ContextualTupleKeys.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ContextualTupleKeys @@ -113,12 +113,12 @@ public bool Equals(ContextualTupleKeys input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKeys != null) { - hashCode = (hashCode * 9923) + this.TupleKeys.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKeys.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CreateStoreRequest.cs b/src/OpenFga.Sdk/Model/CreateStoreRequest.cs index ca9a91a2..b71b199f 100644 --- a/src/OpenFga.Sdk/Model/CreateStoreRequest.cs +++ b/src/OpenFga.Sdk/Model/CreateStoreRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CreateStoreRequest @@ -112,12 +112,12 @@ public bool Equals(CreateStoreRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/CreateStoreResponse.cs b/src/OpenFga.Sdk/Model/CreateStoreResponse.cs index e8a05880..d5354690 100644 --- a/src/OpenFga.Sdk/Model/CreateStoreResponse.cs +++ b/src/OpenFga.Sdk/Model/CreateStoreResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// CreateStoreResponse @@ -161,21 +161,21 @@ public bool Equals(CreateStoreResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.CreatedAt != null) { - hashCode = (hashCode * 9923) + this.CreatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.CreatedAt.GetHashCode(); } if (this.UpdatedAt != null) { - hashCode = (hashCode * 9923) + this.UpdatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.UpdatedAt.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Difference.cs b/src/OpenFga.Sdk/Model/Difference.cs index 41867e03..103b8220 100644 --- a/src/OpenFga.Sdk/Model/Difference.cs +++ b/src/OpenFga.Sdk/Model/Difference.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Difference @@ -131,15 +131,15 @@ public bool Equals(Difference input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Base != null) { - hashCode = (hashCode * 9923) + this.Base.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Base.GetHashCode(); } if (this.Subtract != null) { - hashCode = (hashCode * 9923) + this.Subtract.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Subtract.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ErrorCode.cs b/src/OpenFga.Sdk/Model/ErrorCode.cs index 7be1fa25..558dc3d0 100644 --- a/src/OpenFga.Sdk/Model/ErrorCode.cs +++ b/src/OpenFga.Sdk/Model/ErrorCode.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines ErrorCode diff --git a/src/OpenFga.Sdk/Model/ExpandRequest.cs b/src/OpenFga.Sdk/Model/ExpandRequest.cs index c404cbfc..af10a452 100644 --- a/src/OpenFga.Sdk/Model/ExpandRequest.cs +++ b/src/OpenFga.Sdk/Model/ExpandRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ExpandRequest @@ -155,19 +155,19 @@ public bool Equals(ExpandRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ExpandRequestTupleKey.cs b/src/OpenFga.Sdk/Model/ExpandRequestTupleKey.cs index 9a511a8c..5629ff24 100644 --- a/src/OpenFga.Sdk/Model/ExpandRequestTupleKey.cs +++ b/src/OpenFga.Sdk/Model/ExpandRequestTupleKey.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ExpandRequestTupleKey @@ -131,15 +131,15 @@ public bool Equals(ExpandRequestTupleKey input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ExpandResponse.cs b/src/OpenFga.Sdk/Model/ExpandResponse.cs index 71b8312b..074cc05a 100644 --- a/src/OpenFga.Sdk/Model/ExpandResponse.cs +++ b/src/OpenFga.Sdk/Model/ExpandResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ExpandResponse @@ -108,12 +108,12 @@ public bool Equals(ExpandResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Tree != null) { - hashCode = (hashCode * 9923) + this.Tree.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Tree.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/FgaObject.cs b/src/OpenFga.Sdk/Model/FgaObject.cs index 866211c4..1952bf9b 100644 --- a/src/OpenFga.Sdk/Model/FgaObject.cs +++ b/src/OpenFga.Sdk/Model/FgaObject.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Object represents an OpenFGA Object. An Object is composed of a type and identifier (e.g. 'document:1') See https://openfga.dev/docs/concepts#what-is-an-object @@ -131,15 +131,15 @@ public bool Equals(FgaObject input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ForbiddenResponse.cs b/src/OpenFga.Sdk/Model/ForbiddenResponse.cs index d6c5bed7..fa4bd42d 100644 --- a/src/OpenFga.Sdk/Model/ForbiddenResponse.cs +++ b/src/OpenFga.Sdk/Model/ForbiddenResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ForbiddenResponse @@ -121,13 +121,13 @@ public bool Equals(ForbiddenResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/GetStoreResponse.cs b/src/OpenFga.Sdk/Model/GetStoreResponse.cs index 58ac5019..0522c5b7 100644 --- a/src/OpenFga.Sdk/Model/GetStoreResponse.cs +++ b/src/OpenFga.Sdk/Model/GetStoreResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// GetStoreResponse @@ -176,24 +176,24 @@ public bool Equals(GetStoreResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.CreatedAt != null) { - hashCode = (hashCode * 9923) + this.CreatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.CreatedAt.GetHashCode(); } if (this.UpdatedAt != null) { - hashCode = (hashCode * 9923) + this.UpdatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.UpdatedAt.GetHashCode(); } if (this.DeletedAt != null) { - hashCode = (hashCode * 9923) + this.DeletedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.DeletedAt.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/InternalErrorCode.cs b/src/OpenFga.Sdk/Model/InternalErrorCode.cs index 8f18ad46..6b9275c0 100644 --- a/src/OpenFga.Sdk/Model/InternalErrorCode.cs +++ b/src/OpenFga.Sdk/Model/InternalErrorCode.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines InternalErrorCode diff --git a/src/OpenFga.Sdk/Model/InternalErrorMessageResponse.cs b/src/OpenFga.Sdk/Model/InternalErrorMessageResponse.cs index 983b7734..f926ce7c 100644 --- a/src/OpenFga.Sdk/Model/InternalErrorMessageResponse.cs +++ b/src/OpenFga.Sdk/Model/InternalErrorMessageResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// InternalErrorMessageResponse @@ -121,13 +121,13 @@ public bool Equals(InternalErrorMessageResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Leaf.cs b/src/OpenFga.Sdk/Model/Leaf.cs index 062b18ec..49ea59b9 100644 --- a/src/OpenFga.Sdk/Model/Leaf.cs +++ b/src/OpenFga.Sdk/Model/Leaf.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// A leaf node contains either - a set of users (which may be individual users, or usersets referencing other relations) - a computed node, which is the result of a computed userset value in the authorization model - a tupleToUserset nodes, containing the result of expanding a tupleToUserset value in a authorization model. @@ -138,18 +138,18 @@ public bool Equals(Leaf input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Users != null) { - hashCode = (hashCode * 9923) + this.Users.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Users.GetHashCode(); } if (this.Computed != null) { - hashCode = (hashCode * 9923) + this.Computed.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Computed.GetHashCode(); } if (this.TupleToUserset != null) { - hashCode = (hashCode * 9923) + this.TupleToUserset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleToUserset.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ListObjectsRequest.cs b/src/OpenFga.Sdk/Model/ListObjectsRequest.cs index 19d198ab..a9987aa1 100644 --- a/src/OpenFga.Sdk/Model/ListObjectsRequest.cs +++ b/src/OpenFga.Sdk/Model/ListObjectsRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ListObjectsRequest @@ -209,28 +209,28 @@ public bool Equals(ListObjectsRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ListObjectsResponse.cs b/src/OpenFga.Sdk/Model/ListObjectsResponse.cs index 52fcf82c..b8f4e1ea 100644 --- a/src/OpenFga.Sdk/Model/ListObjectsResponse.cs +++ b/src/OpenFga.Sdk/Model/ListObjectsResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ListObjectsResponse @@ -113,12 +113,12 @@ public bool Equals(ListObjectsResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Objects != null) { - hashCode = (hashCode * 9923) + this.Objects.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Objects.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ListStoresResponse.cs b/src/OpenFga.Sdk/Model/ListStoresResponse.cs index 8e927d30..26a993ed 100644 --- a/src/OpenFga.Sdk/Model/ListStoresResponse.cs +++ b/src/OpenFga.Sdk/Model/ListStoresResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ListStoresResponse @@ -133,15 +133,15 @@ public bool Equals(ListStoresResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Stores != null) { - hashCode = (hashCode * 9923) + this.Stores.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Stores.GetHashCode(); } if (this.ContinuationToken != null) { - hashCode = (hashCode * 9923) + this.ContinuationToken.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContinuationToken.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ListUsersRequest.cs b/src/OpenFga.Sdk/Model/ListUsersRequest.cs index 661ecc81..cd5e1ebc 100644 --- a/src/OpenFga.Sdk/Model/ListUsersRequest.cs +++ b/src/OpenFga.Sdk/Model/ListUsersRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ListUsersRequest @@ -212,28 +212,28 @@ public bool Equals(ListUsersRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.UserFilters != null) { - hashCode = (hashCode * 9923) + this.UserFilters.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.UserFilters.GetHashCode(); } if (this.ContextualTuples != null) { - hashCode = (hashCode * 9923) + this.ContextualTuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContextualTuples.GetHashCode(); } if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ListUsersResponse.cs b/src/OpenFga.Sdk/Model/ListUsersResponse.cs index 5c744be7..f729a9d7 100644 --- a/src/OpenFga.Sdk/Model/ListUsersResponse.cs +++ b/src/OpenFga.Sdk/Model/ListUsersResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ListUsersResponse @@ -113,12 +113,12 @@ public bool Equals(ListUsersResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Users != null) { - hashCode = (hashCode * 9923) + this.Users.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Users.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Metadata.cs b/src/OpenFga.Sdk/Model/Metadata.cs index b60a2ad0..0844a768 100644 --- a/src/OpenFga.Sdk/Model/Metadata.cs +++ b/src/OpenFga.Sdk/Model/Metadata.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Metadata @@ -139,18 +139,18 @@ public bool Equals(Metadata input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Relations != null) { - hashCode = (hashCode * 9923) + this.Relations.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relations.GetHashCode(); } if (this.Module != null) { - hashCode = (hashCode * 9923) + this.Module.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Module.GetHashCode(); } if (this.SourceInfo != null) { - hashCode = (hashCode * 9923) + this.SourceInfo.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.SourceInfo.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Node.cs b/src/OpenFga.Sdk/Model/Node.cs index 8887ea42..60f12f08 100644 --- a/src/OpenFga.Sdk/Model/Node.cs +++ b/src/OpenFga.Sdk/Model/Node.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Node @@ -172,24 +172,24 @@ public bool Equals(Node input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.Leaf != null) { - hashCode = (hashCode * 9923) + this.Leaf.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Leaf.GetHashCode(); } if (this.Difference != null) { - hashCode = (hashCode * 9923) + this.Difference.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Difference.GetHashCode(); } if (this.Union != null) { - hashCode = (hashCode * 9923) + this.Union.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Union.GetHashCode(); } if (this.Intersection != null) { - hashCode = (hashCode * 9923) + this.Intersection.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Intersection.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Nodes.cs b/src/OpenFga.Sdk/Model/Nodes.cs index a8a2b372..9f3442d6 100644 --- a/src/OpenFga.Sdk/Model/Nodes.cs +++ b/src/OpenFga.Sdk/Model/Nodes.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Nodes @@ -113,12 +113,12 @@ public bool Equals(Nodes input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.VarNodes != null) { - hashCode = (hashCode * 9923) + this.VarNodes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.VarNodes.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/NotFoundErrorCode.cs b/src/OpenFga.Sdk/Model/NotFoundErrorCode.cs index 945a7391..e5c81a37 100644 --- a/src/OpenFga.Sdk/Model/NotFoundErrorCode.cs +++ b/src/OpenFga.Sdk/Model/NotFoundErrorCode.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines NotFoundErrorCode diff --git a/src/OpenFga.Sdk/Model/NullValue.cs b/src/OpenFga.Sdk/Model/NullValue.cs index dd12e235..5bc14416 100644 --- a/src/OpenFga.Sdk/Model/NullValue.cs +++ b/src/OpenFga.Sdk/Model/NullValue.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. - NULL_VALUE: Null value. diff --git a/src/OpenFga.Sdk/Model/ObjectRelation.cs b/src/OpenFga.Sdk/Model/ObjectRelation.cs index f6f46ab0..da735351 100644 --- a/src/OpenFga.Sdk/Model/ObjectRelation.cs +++ b/src/OpenFga.Sdk/Model/ObjectRelation.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ObjectRelation @@ -123,15 +123,15 @@ public bool Equals(ObjectRelation input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/PathUnknownErrorMessageResponse.cs b/src/OpenFga.Sdk/Model/PathUnknownErrorMessageResponse.cs index 3925b4f5..cd53a1e7 100644 --- a/src/OpenFga.Sdk/Model/PathUnknownErrorMessageResponse.cs +++ b/src/OpenFga.Sdk/Model/PathUnknownErrorMessageResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// PathUnknownErrorMessageResponse @@ -121,13 +121,13 @@ public bool Equals(PathUnknownErrorMessageResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadAssertionsResponse.cs b/src/OpenFga.Sdk/Model/ReadAssertionsResponse.cs index 9717a43d..ba8ff579 100644 --- a/src/OpenFga.Sdk/Model/ReadAssertionsResponse.cs +++ b/src/OpenFga.Sdk/Model/ReadAssertionsResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadAssertionsResponse @@ -128,15 +128,15 @@ public bool Equals(ReadAssertionsResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } if (this.Assertions != null) { - hashCode = (hashCode * 9923) + this.Assertions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Assertions.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadAuthorizationModelResponse.cs b/src/OpenFga.Sdk/Model/ReadAuthorizationModelResponse.cs index fe9bb962..5a7626bc 100644 --- a/src/OpenFga.Sdk/Model/ReadAuthorizationModelResponse.cs +++ b/src/OpenFga.Sdk/Model/ReadAuthorizationModelResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadAuthorizationModelResponse @@ -108,12 +108,12 @@ public bool Equals(ReadAuthorizationModelResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModel != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModel.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModel.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadAuthorizationModelsResponse.cs b/src/OpenFga.Sdk/Model/ReadAuthorizationModelsResponse.cs index 852909b7..f36cc5cc 100644 --- a/src/OpenFga.Sdk/Model/ReadAuthorizationModelsResponse.cs +++ b/src/OpenFga.Sdk/Model/ReadAuthorizationModelsResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadAuthorizationModelsResponse @@ -129,15 +129,15 @@ public bool Equals(ReadAuthorizationModelsResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModels != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModels.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModels.GetHashCode(); } if (this.ContinuationToken != null) { - hashCode = (hashCode * 9923) + this.ContinuationToken.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContinuationToken.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadChangesResponse.cs b/src/OpenFga.Sdk/Model/ReadChangesResponse.cs index 04929c51..17cb2aae 100644 --- a/src/OpenFga.Sdk/Model/ReadChangesResponse.cs +++ b/src/OpenFga.Sdk/Model/ReadChangesResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadChangesResponse @@ -129,15 +129,15 @@ public bool Equals(ReadChangesResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Changes != null) { - hashCode = (hashCode * 9923) + this.Changes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Changes.GetHashCode(); } if (this.ContinuationToken != null) { - hashCode = (hashCode * 9923) + this.ContinuationToken.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContinuationToken.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadRequest.cs b/src/OpenFga.Sdk/Model/ReadRequest.cs index de53e06b..aad50ad5 100644 --- a/src/OpenFga.Sdk/Model/ReadRequest.cs +++ b/src/OpenFga.Sdk/Model/ReadRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadRequest @@ -150,17 +150,17 @@ public bool Equals(ReadRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } - hashCode = (hashCode * 9923) + this.PageSize.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.PageSize.GetHashCode(); if (this.ContinuationToken != null) { - hashCode = (hashCode * 9923) + this.ContinuationToken.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContinuationToken.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Consistency.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Consistency.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadRequestTupleKey.cs b/src/OpenFga.Sdk/Model/ReadRequestTupleKey.cs index 2e87fd7d..6137aacf 100644 --- a/src/OpenFga.Sdk/Model/ReadRequestTupleKey.cs +++ b/src/OpenFga.Sdk/Model/ReadRequestTupleKey.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadRequestTupleKey @@ -138,18 +138,18 @@ public bool Equals(ReadRequestTupleKey input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ReadResponse.cs b/src/OpenFga.Sdk/Model/ReadResponse.cs index f2b6d752..de999e95 100644 --- a/src/OpenFga.Sdk/Model/ReadResponse.cs +++ b/src/OpenFga.Sdk/Model/ReadResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ReadResponse @@ -133,15 +133,15 @@ public bool Equals(ReadResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Tuples != null) { - hashCode = (hashCode * 9923) + this.Tuples.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Tuples.GetHashCode(); } if (this.ContinuationToken != null) { - hashCode = (hashCode * 9923) + this.ContinuationToken.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ContinuationToken.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/RelationMetadata.cs b/src/OpenFga.Sdk/Model/RelationMetadata.cs index ca78e458..d9fecd24 100644 --- a/src/OpenFga.Sdk/Model/RelationMetadata.cs +++ b/src/OpenFga.Sdk/Model/RelationMetadata.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// RelationMetadata @@ -139,18 +139,18 @@ public bool Equals(RelationMetadata input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.DirectlyRelatedUserTypes != null) { - hashCode = (hashCode * 9923) + this.DirectlyRelatedUserTypes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.DirectlyRelatedUserTypes.GetHashCode(); } if (this.Module != null) { - hashCode = (hashCode * 9923) + this.Module.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Module.GetHashCode(); } if (this.SourceInfo != null) { - hashCode = (hashCode * 9923) + this.SourceInfo.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.SourceInfo.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/RelationReference.cs b/src/OpenFga.Sdk/Model/RelationReference.cs index ec0c6ab8..f14f9801 100644 --- a/src/OpenFga.Sdk/Model/RelationReference.cs +++ b/src/OpenFga.Sdk/Model/RelationReference.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// RelationReference represents a relation of a particular object type (e.g. 'document#viewer'). @@ -158,21 +158,21 @@ public bool Equals(RelationReference input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Wildcard != null) { - hashCode = (hashCode * 9923) + this.Wildcard.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Wildcard.GetHashCode(); } if (this.Condition != null) { - hashCode = (hashCode * 9923) + this.Condition.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Condition.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/RelationshipCondition.cs b/src/OpenFga.Sdk/Model/RelationshipCondition.cs index ece3b0c1..5f7d050a 100644 --- a/src/OpenFga.Sdk/Model/RelationshipCondition.cs +++ b/src/OpenFga.Sdk/Model/RelationshipCondition.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// RelationshipCondition @@ -129,15 +129,15 @@ public bool Equals(RelationshipCondition input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.Context != null) { - hashCode = (hashCode * 9923) + this.Context.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Context.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/SourceInfo.cs b/src/OpenFga.Sdk/Model/SourceInfo.cs index 78fb4eca..aff42f5c 100644 --- a/src/OpenFga.Sdk/Model/SourceInfo.cs +++ b/src/OpenFga.Sdk/Model/SourceInfo.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// SourceInfo @@ -108,12 +108,12 @@ public bool Equals(SourceInfo input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.File != null) { - hashCode = (hashCode * 9923) + this.File.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.File.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Status.cs b/src/OpenFga.Sdk/Model/Status.cs index 1e5b58dc..b7709d7c 100644 --- a/src/OpenFga.Sdk/Model/Status.cs +++ b/src/OpenFga.Sdk/Model/Status.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Status @@ -138,16 +138,16 @@ public bool Equals(Status input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.Details != null) { - hashCode = (hashCode * 9923) + this.Details.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Details.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Store.cs b/src/OpenFga.Sdk/Model/Store.cs index 9605f23c..e5b77317 100644 --- a/src/OpenFga.Sdk/Model/Store.cs +++ b/src/OpenFga.Sdk/Model/Store.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Store @@ -176,24 +176,24 @@ public bool Equals(Store input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.Name != null) { - hashCode = (hashCode * 9923) + this.Name.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Name.GetHashCode(); } if (this.CreatedAt != null) { - hashCode = (hashCode * 9923) + this.CreatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.CreatedAt.GetHashCode(); } if (this.UpdatedAt != null) { - hashCode = (hashCode * 9923) + this.UpdatedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.UpdatedAt.GetHashCode(); } if (this.DeletedAt != null) { - hashCode = (hashCode * 9923) + this.DeletedAt.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.DeletedAt.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Tuple.cs b/src/OpenFga.Sdk/Model/Tuple.cs index 57035ec7..dfca1861 100644 --- a/src/OpenFga.Sdk/Model/Tuple.cs +++ b/src/OpenFga.Sdk/Model/Tuple.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Tuple @@ -127,15 +127,15 @@ public bool Equals(Tuple input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Key != null) { - hashCode = (hashCode * 9923) + this.Key.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Key.GetHashCode(); } if (this.Timestamp != null) { - hashCode = (hashCode * 9923) + this.Timestamp.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Timestamp.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TupleChange.cs b/src/OpenFga.Sdk/Model/TupleChange.cs index 6d1b7b7f..2aa367bc 100644 --- a/src/OpenFga.Sdk/Model/TupleChange.cs +++ b/src/OpenFga.Sdk/Model/TupleChange.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// TupleChange @@ -140,16 +140,16 @@ public bool Equals(TupleChange input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKey != null) { - hashCode = (hashCode * 9923) + this.TupleKey.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKey.GetHashCode(); } - hashCode = (hashCode * 9923) + this.Operation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Operation.GetHashCode(); if (this.Timestamp != null) { - hashCode = (hashCode * 9923) + this.Timestamp.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Timestamp.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TupleKey.cs b/src/OpenFga.Sdk/Model/TupleKey.cs index 5e1a354e..8e85cf34 100644 --- a/src/OpenFga.Sdk/Model/TupleKey.cs +++ b/src/OpenFga.Sdk/Model/TupleKey.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// TupleKey @@ -165,21 +165,21 @@ public bool Equals(TupleKey input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.Condition != null) { - hashCode = (hashCode * 9923) + this.Condition.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Condition.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TupleKeyWithoutCondition.cs b/src/OpenFga.Sdk/Model/TupleKeyWithoutCondition.cs index 6de32f9a..5a26ce19 100644 --- a/src/OpenFga.Sdk/Model/TupleKeyWithoutCondition.cs +++ b/src/OpenFga.Sdk/Model/TupleKeyWithoutCondition.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// TupleKeyWithoutCondition @@ -150,18 +150,18 @@ public bool Equals(TupleKeyWithoutCondition input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.User != null) { - hashCode = (hashCode * 9923) + this.User.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.User.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TupleOperation.cs b/src/OpenFga.Sdk/Model/TupleOperation.cs index f5012323..66b2794f 100644 --- a/src/OpenFga.Sdk/Model/TupleOperation.cs +++ b/src/OpenFga.Sdk/Model/TupleOperation.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines TupleOperation diff --git a/src/OpenFga.Sdk/Model/TupleToUserset.cs b/src/OpenFga.Sdk/Model/TupleToUserset.cs index 8afdfdb2..c18653e0 100644 --- a/src/OpenFga.Sdk/Model/TupleToUserset.cs +++ b/src/OpenFga.Sdk/Model/TupleToUserset.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// TupleToUserset @@ -131,15 +131,15 @@ public bool Equals(TupleToUserset input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Tupleset != null) { - hashCode = (hashCode * 9923) + this.Tupleset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Tupleset.GetHashCode(); } if (this.ComputedUserset != null) { - hashCode = (hashCode * 9923) + this.ComputedUserset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ComputedUserset.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TypeDefinition.cs b/src/OpenFga.Sdk/Model/TypeDefinition.cs index 15ca95c9..7f97f293 100644 --- a/src/OpenFga.Sdk/Model/TypeDefinition.cs +++ b/src/OpenFga.Sdk/Model/TypeDefinition.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// TypeDefinition @@ -143,18 +143,18 @@ public bool Equals(TypeDefinition input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Relations != null) { - hashCode = (hashCode * 9923) + this.Relations.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relations.GetHashCode(); } if (this.Metadata != null) { - hashCode = (hashCode * 9923) + this.Metadata.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Metadata.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/TypeName.cs b/src/OpenFga.Sdk/Model/TypeName.cs index 094ca5c2..be58945b 100644 --- a/src/OpenFga.Sdk/Model/TypeName.cs +++ b/src/OpenFga.Sdk/Model/TypeName.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines TypeName diff --git a/src/OpenFga.Sdk/Model/TypedWildcard.cs b/src/OpenFga.Sdk/Model/TypedWildcard.cs index 1c4ad985..866130f0 100644 --- a/src/OpenFga.Sdk/Model/TypedWildcard.cs +++ b/src/OpenFga.Sdk/Model/TypedWildcard.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Type bound public access. Normally represented using the `<type>:*` syntax `employee:*` represents every object of type `employee`, including those not currently present in the system See https://openfga.dev/docs/concepts#what-is-type-bound-public-access @@ -112,12 +112,12 @@ public bool Equals(TypedWildcard input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UnauthenticatedResponse.cs b/src/OpenFga.Sdk/Model/UnauthenticatedResponse.cs index 881db8dc..dfb1aecf 100644 --- a/src/OpenFga.Sdk/Model/UnauthenticatedResponse.cs +++ b/src/OpenFga.Sdk/Model/UnauthenticatedResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// UnauthenticatedResponse @@ -121,13 +121,13 @@ public bool Equals(UnauthenticatedResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UnprocessableContentErrorCode.cs b/src/OpenFga.Sdk/Model/UnprocessableContentErrorCode.cs index 113b0a72..2dc572aa 100644 --- a/src/OpenFga.Sdk/Model/UnprocessableContentErrorCode.cs +++ b/src/OpenFga.Sdk/Model/UnprocessableContentErrorCode.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Defines UnprocessableContentErrorCode diff --git a/src/OpenFga.Sdk/Model/UnprocessableContentMessageResponse.cs b/src/OpenFga.Sdk/Model/UnprocessableContentMessageResponse.cs index 98c23ec9..a57e1ffc 100644 --- a/src/OpenFga.Sdk/Model/UnprocessableContentMessageResponse.cs +++ b/src/OpenFga.Sdk/Model/UnprocessableContentMessageResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// UnprocessableContentMessageResponse @@ -121,13 +121,13 @@ public bool Equals(UnprocessableContentMessageResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/User.cs b/src/OpenFga.Sdk/Model/User.cs index a14dabec..b3eca86e 100644 --- a/src/OpenFga.Sdk/Model/User.cs +++ b/src/OpenFga.Sdk/Model/User.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// User. Represents any possible value for a user (subject or principal). Can be a: - Specific user object e.g.: 'user:will', 'folder:marketing', 'org:contoso', ...) - Specific userset (e.g. 'group:engineering#member') - Public-typed wildcard (e.g. 'user:*') See https://openfga.dev/docs/concepts#what-is-a-user @@ -138,18 +138,18 @@ public bool Equals(User input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Object.GetHashCode(); } if (this.Userset != null) { - hashCode = (hashCode * 9923) + this.Userset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Userset.GetHashCode(); } if (this.Wildcard != null) { - hashCode = (hashCode * 9923) + this.Wildcard.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Wildcard.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UserTypeFilter.cs b/src/OpenFga.Sdk/Model/UserTypeFilter.cs index 84f54633..4d96f95a 100644 --- a/src/OpenFga.Sdk/Model/UserTypeFilter.cs +++ b/src/OpenFga.Sdk/Model/UserTypeFilter.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// UserTypeFilter @@ -127,15 +127,15 @@ public bool Equals(UserTypeFilter input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Users.cs b/src/OpenFga.Sdk/Model/Users.cs index 038afef3..b9b4428a 100644 --- a/src/OpenFga.Sdk/Model/Users.cs +++ b/src/OpenFga.Sdk/Model/Users.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Users @@ -113,12 +113,12 @@ public bool Equals(Users input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.VarUsers != null) { - hashCode = (hashCode * 9923) + this.VarUsers.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.VarUsers.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Userset.cs b/src/OpenFga.Sdk/Model/Userset.cs index 2f832eff..b9e93d62 100644 --- a/src/OpenFga.Sdk/Model/Userset.cs +++ b/src/OpenFga.Sdk/Model/Userset.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Userset @@ -184,27 +184,27 @@ public bool Equals(Userset input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.This != null) { - hashCode = (hashCode * 9923) + this.This.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.This.GetHashCode(); } if (this.ComputedUserset != null) { - hashCode = (hashCode * 9923) + this.ComputedUserset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.ComputedUserset.GetHashCode(); } if (this.TupleToUserset != null) { - hashCode = (hashCode * 9923) + this.TupleToUserset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleToUserset.GetHashCode(); } if (this.Union != null) { - hashCode = (hashCode * 9923) + this.Union.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Union.GetHashCode(); } if (this.Intersection != null) { - hashCode = (hashCode * 9923) + this.Intersection.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Intersection.GetHashCode(); } if (this.Difference != null) { - hashCode = (hashCode * 9923) + this.Difference.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Difference.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UsersetTree.cs b/src/OpenFga.Sdk/Model/UsersetTree.cs index 0b5e8516..aa050cab 100644 --- a/src/OpenFga.Sdk/Model/UsersetTree.cs +++ b/src/OpenFga.Sdk/Model/UsersetTree.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// A UsersetTree contains the result of an Expansion. @@ -108,12 +108,12 @@ public bool Equals(UsersetTree input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Root != null) { - hashCode = (hashCode * 9923) + this.Root.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Root.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UsersetTreeDifference.cs b/src/OpenFga.Sdk/Model/UsersetTreeDifference.cs index ff65e218..3a11a994 100644 --- a/src/OpenFga.Sdk/Model/UsersetTreeDifference.cs +++ b/src/OpenFga.Sdk/Model/UsersetTreeDifference.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// UsersetTreeDifference @@ -131,15 +131,15 @@ public bool Equals(UsersetTreeDifference input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Base != null) { - hashCode = (hashCode * 9923) + this.Base.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Base.GetHashCode(); } if (this.Subtract != null) { - hashCode = (hashCode * 9923) + this.Subtract.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Subtract.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UsersetTreeTupleToUserset.cs b/src/OpenFga.Sdk/Model/UsersetTreeTupleToUserset.cs index c11a9c39..f9ea2a98 100644 --- a/src/OpenFga.Sdk/Model/UsersetTreeTupleToUserset.cs +++ b/src/OpenFga.Sdk/Model/UsersetTreeTupleToUserset.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// UsersetTreeTupleToUserset @@ -132,15 +132,15 @@ public bool Equals(UsersetTreeTupleToUserset input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Tupleset != null) { - hashCode = (hashCode * 9923) + this.Tupleset.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Tupleset.GetHashCode(); } if (this.Computed != null) { - hashCode = (hashCode * 9923) + this.Computed.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Computed.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/UsersetUser.cs b/src/OpenFga.Sdk/Model/UsersetUser.cs index cabb26d0..becad63b 100644 --- a/src/OpenFga.Sdk/Model/UsersetUser.cs +++ b/src/OpenFga.Sdk/Model/UsersetUser.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Userset. A set or group of users, represented in the `<type>:<id>#<relation>` format `group:fga#member` represents all members of group FGA, not to be confused by `group:fga` which represents the group itself as a specific object. See: https://openfga.dev/docs/modeling/building-blocks/usersets#what-is-a-userset @@ -150,18 +150,18 @@ public bool Equals(UsersetUser input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Type != null) { - hashCode = (hashCode * 9923) + this.Type.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Type.GetHashCode(); } if (this.Id != null) { - hashCode = (hashCode * 9923) + this.Id.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Id.GetHashCode(); } if (this.Relation != null) { - hashCode = (hashCode * 9923) + this.Relation.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Relation.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/Usersets.cs b/src/OpenFga.Sdk/Model/Usersets.cs index 459a95d4..7211f811 100644 --- a/src/OpenFga.Sdk/Model/Usersets.cs +++ b/src/OpenFga.Sdk/Model/Usersets.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// Usersets @@ -113,12 +113,12 @@ public bool Equals(Usersets input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Child != null) { - hashCode = (hashCode * 9923) + this.Child.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Child.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/ValidationErrorMessageResponse.cs b/src/OpenFga.Sdk/Model/ValidationErrorMessageResponse.cs index 9f1d8461..e17097b7 100644 --- a/src/OpenFga.Sdk/Model/ValidationErrorMessageResponse.cs +++ b/src/OpenFga.Sdk/Model/ValidationErrorMessageResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// ValidationErrorMessageResponse @@ -121,13 +121,13 @@ public bool Equals(ValidationErrorMessageResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; - hashCode = (hashCode * 9923) + this.Code.GetHashCode(); + int hashCode = FgaConstants.HashCodeBasePrimeNumber; + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Code.GetHashCode(); if (this.Message != null) { - hashCode = (hashCode * 9923) + this.Message.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Message.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteAssertionsRequest.cs b/src/OpenFga.Sdk/Model/WriteAssertionsRequest.cs index 1f4bc9e0..8d847d6d 100644 --- a/src/OpenFga.Sdk/Model/WriteAssertionsRequest.cs +++ b/src/OpenFga.Sdk/Model/WriteAssertionsRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteAssertionsRequest @@ -113,12 +113,12 @@ public bool Equals(WriteAssertionsRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Assertions != null) { - hashCode = (hashCode * 9923) + this.Assertions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Assertions.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteAuthorizationModelRequest.cs b/src/OpenFga.Sdk/Model/WriteAuthorizationModelRequest.cs index 6a276564..7281927e 100644 --- a/src/OpenFga.Sdk/Model/WriteAuthorizationModelRequest.cs +++ b/src/OpenFga.Sdk/Model/WriteAuthorizationModelRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteAuthorizationModelRequest @@ -148,18 +148,18 @@ public bool Equals(WriteAuthorizationModelRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TypeDefinitions != null) { - hashCode = (hashCode * 9923) + this.TypeDefinitions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TypeDefinitions.GetHashCode(); } if (this.SchemaVersion != null) { - hashCode = (hashCode * 9923) + this.SchemaVersion.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.SchemaVersion.GetHashCode(); } if (this.Conditions != null) { - hashCode = (hashCode * 9923) + this.Conditions.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Conditions.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteAuthorizationModelResponse.cs b/src/OpenFga.Sdk/Model/WriteAuthorizationModelResponse.cs index 98d7a4ff..d1592258 100644 --- a/src/OpenFga.Sdk/Model/WriteAuthorizationModelResponse.cs +++ b/src/OpenFga.Sdk/Model/WriteAuthorizationModelResponse.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteAuthorizationModelResponse @@ -112,12 +112,12 @@ public bool Equals(WriteAuthorizationModelResponse input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteRequest.cs b/src/OpenFga.Sdk/Model/WriteRequest.cs index 4790d215..e7b6a696 100644 --- a/src/OpenFga.Sdk/Model/WriteRequest.cs +++ b/src/OpenFga.Sdk/Model/WriteRequest.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteRequest @@ -138,18 +138,18 @@ public bool Equals(WriteRequest input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.Writes != null) { - hashCode = (hashCode * 9923) + this.Writes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Writes.GetHashCode(); } if (this.Deletes != null) { - hashCode = (hashCode * 9923) + this.Deletes.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.Deletes.GetHashCode(); } if (this.AuthorizationModelId != null) { - hashCode = (hashCode * 9923) + this.AuthorizationModelId.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AuthorizationModelId.GetHashCode(); } if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteRequestDeletes.cs b/src/OpenFga.Sdk/Model/WriteRequestDeletes.cs index 6301a5ab..16e58478 100644 --- a/src/OpenFga.Sdk/Model/WriteRequestDeletes.cs +++ b/src/OpenFga.Sdk/Model/WriteRequestDeletes.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteRequestDeletes @@ -147,13 +147,13 @@ public bool Equals(WriteRequestDeletes input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKeys != null) { - hashCode = (hashCode * 9923) + this.TupleKeys.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKeys.GetHashCode(); } - hashCode = (hashCode * 9923) + this.OnMissing.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.OnMissing.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Model/WriteRequestWrites.cs b/src/OpenFga.Sdk/Model/WriteRequestWrites.cs index 0fd125cc..b162f9f5 100644 --- a/src/OpenFga.Sdk/Model/WriteRequestWrites.cs +++ b/src/OpenFga.Sdk/Model/WriteRequestWrites.cs @@ -11,6 +11,7 @@ // +using OpenFga.Sdk.Constants; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -19,7 +20,6 @@ using System.Text.Json; using System.Text.Json.Serialization; - namespace OpenFga.Sdk.Model { /// /// WriteRequestWrites @@ -147,13 +147,13 @@ public bool Equals(WriteRequestWrites input) { public override int GetHashCode() { unchecked // Overflow is fine, just wrap { - int hashCode = 9661; + int hashCode = FgaConstants.HashCodeBasePrimeNumber; if (this.TupleKeys != null) { - hashCode = (hashCode * 9923) + this.TupleKeys.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.TupleKeys.GetHashCode(); } - hashCode = (hashCode * 9923) + this.OnDuplicate.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.OnDuplicate.GetHashCode(); if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); + hashCode = (hashCode * FgaConstants.HashCodeMultiplierPrimeNumber) + this.AdditionalProperties.GetHashCode(); } return hashCode; } diff --git a/src/OpenFga.Sdk/Telemetry/Attributes.cs b/src/OpenFga.Sdk/Telemetry/Attributes.cs index 7e5a08ed..9968b864 100644 --- a/src/OpenFga.Sdk/Telemetry/Attributes.cs +++ b/src/OpenFga.Sdk/Telemetry/Attributes.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.ApiClient; using OpenFga.Sdk.Configuration; using System.Collections.Generic; diff --git a/src/OpenFga.Sdk/Telemetry/Counters.cs b/src/OpenFga.Sdk/Telemetry/Counters.cs index 86de2e60..2bd53d2a 100644 --- a/src/OpenFga.Sdk/Telemetry/Counters.cs +++ b/src/OpenFga.Sdk/Telemetry/Counters.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Diagnostics; using System.Diagnostics.Metrics; diff --git a/src/OpenFga.Sdk/Telemetry/Histograms.cs b/src/OpenFga.Sdk/Telemetry/Histograms.cs index 2ecaddc9..ad544bd7 100644 --- a/src/OpenFga.Sdk/Telemetry/Histograms.cs +++ b/src/OpenFga.Sdk/Telemetry/Histograms.cs @@ -1,16 +1,4 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - +using OpenFga.Sdk.Constants; using System.Diagnostics; using System.Diagnostics.Metrics; using System.Linq; @@ -49,9 +37,9 @@ public TelemetryHistograms(Meter meter) { /// The HTTP response message. /// The attributes associated with the telemetry data. public void RecordQueryDuration(HttpResponseMessage response, TagList attributes) { - if (response.Headers.Contains("fga-query-duration-ms") && - response.Headers.GetValues("fga-query-duration-ms").Any()) { - var durationHeader = response.Headers.GetValues("fga-query-duration-ms").First(); + if (response.Headers.Contains(FgaConstants.QueryDurationHeaderName) && + response.Headers.GetValues(FgaConstants.QueryDurationHeaderName).Any()) { + var durationHeader = response.Headers.GetValues(FgaConstants.QueryDurationHeaderName).First(); if (!string.IsNullOrEmpty(durationHeader) && float.TryParse(durationHeader, out var durationFloat)) { QueryDurationHistogram?.Record(durationFloat, attributes); } diff --git a/src/OpenFga.Sdk/Telemetry/Meters.cs b/src/OpenFga.Sdk/Telemetry/Meters.cs index 7c8abe32..88fdc828 100644 --- a/src/OpenFga.Sdk/Telemetry/Meters.cs +++ b/src/OpenFga.Sdk/Telemetry/Meters.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using System.Collections.Generic; namespace OpenFga.Sdk.Telemetry; diff --git a/src/OpenFga.Sdk/Telemetry/Metrics.cs b/src/OpenFga.Sdk/Telemetry/Metrics.cs index 3c23ecd9..10d30fe1 100644 --- a/src/OpenFga.Sdk/Telemetry/Metrics.cs +++ b/src/OpenFga.Sdk/Telemetry/Metrics.cs @@ -1,16 +1,3 @@ -// -// OpenFGA/.NET SDK for OpenFGA -// -// API version: 1.x -// Website: https://openfga.dev -// Documentation: https://openfga.dev/docs -// Support: https://openfga.dev/community -// License: [Apache-2.0](https://github.com/openfga/dotnet-sdk/blob/main/LICENSE) -// -// NOTE: This file was auto generated. DO NOT EDIT. -// - - using OpenFga.Sdk.ApiClient; using OpenFga.Sdk.Configuration; using System.Collections.Generic;