Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -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/*
95 changes: 2 additions & 93 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
18 changes: 2 additions & 16 deletions src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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]
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk.Test/Models/ModelTests.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk/ApiClient/ApiClient.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk/ApiClient/BaseClient.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 3 additions & 15 deletions src/OpenFga.Sdk/ApiClient/OAuth2Client.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -30,10 +18,10 @@ namespace OpenFga.Sdk.ApiClient;
/// OAuth2 Client to exchange the credentials for an access token using the client credentials flow
/// </summary>
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;
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk/ApiClient/RequestBuilder.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/OpenFga.Sdk/ApiClient/Utils.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading
Loading