diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2992f98..d08e11c 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -52,7 +52,6 @@ docs/Node.md docs/Nodes.md docs/NotFoundErrorCode.md docs/NullValue.md -docs/ObjectOrUserset.md docs/ObjectRelation.md docs/OpenFgaApi.md docs/PathUnknownErrorMessageResponse.md @@ -201,7 +200,6 @@ src/OpenFga.Sdk/Model/Node.cs src/OpenFga.Sdk/Model/Nodes.cs src/OpenFga.Sdk/Model/NotFoundErrorCode.cs src/OpenFga.Sdk/Model/NullValue.cs -src/OpenFga.Sdk/Model/ObjectOrUserset.cs src/OpenFga.Sdk/Model/ObjectRelation.cs src/OpenFga.Sdk/Model/PathUnknownErrorMessageResponse.cs src/OpenFga.Sdk/Model/ReadAssertionsResponse.cs diff --git a/README.md b/README.md index dd1714e..16ff8ca 100644 --- a/README.md +++ b/README.md @@ -746,7 +746,6 @@ const response = await fgaClient.listUsers({ }, options); // response.users = [{object: {type: "user", id: "81684243-9356-4421-8fbf-a4f8d36aa31b"}}, {userset: { type: "user" }}, ...] -// response.excluded_users = [ {object: {type: "user", id: "4a455e27-d15a-4434-82e0-136f9c2aa4cf"}}, ... ] ``` #### Assertions @@ -882,7 +881,6 @@ namespace Example { - [Model.Nodes](docs/Nodes.md) - [Model.NotFoundErrorCode](docs/NotFoundErrorCode.md) - [Model.NullValue](docs/NullValue.md) - - [Model.ObjectOrUserset](docs/ObjectOrUserset.md) - [Model.ObjectRelation](docs/ObjectRelation.md) - [Model.PathUnknownErrorMessageResponse](docs/PathUnknownErrorMessageResponse.md) - [Model.ReadAssertionsResponse](docs/ReadAssertionsResponse.md) diff --git a/docs/ListUsersResponse.md b/docs/ListUsersResponse.md index cf1e6f1..9dc9baf 100644 --- a/docs/ListUsersResponse.md +++ b/docs/ListUsersResponse.md @@ -5,7 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Users** | [**List<User>**](User.md) | | -**ExcludedUsers** | [**List<ObjectOrUserset>**](ObjectOrUserset.md) | | [[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ObjectOrUserset.md b/docs/ObjectOrUserset.md deleted file mode 100644 index 0e94414..0000000 --- a/docs/ObjectOrUserset.md +++ /dev/null @@ -1,11 +0,0 @@ -# OpenFga.Sdk.Model.ObjectOrUserset - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Object** | [**FgaObject**](FgaObject.md) | | [optional] -**Userset** | [**UsersetUser**](UsersetUser.md) | | [optional] - -[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/OpenFgaApi.md b/docs/OpenFgaApi.md index e53fa89..f8ddd75 100644 --- a/docs/OpenFgaApi.md +++ b/docs/OpenFgaApi.md @@ -581,7 +581,7 @@ Name | Type | Description | Notes [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type. -The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. This API is available in an experimental capacity and can be enabled with the `- -experimentals enable-list-users` flag. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In certain cases of negation via the `but not` operator, some results are marked as excluded from the main set of results. These exclusions are returned in the `excluded_users` property and should be handled appropriately at the point of implementation.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users. +The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. This API is available in an experimental capacity and can be enabled with the `- -experimentals enable-list-users` flag. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In cases where a type-bound public acces result is returned (e.g. `user:*`), it cannot be inferred that all subjects of that type have a relation to the object; it is possible that negations exist and checks should still be queried on individual subjects to ensure access to that document.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users. ### Example ```csharp diff --git a/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs b/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs index 3b52c37..a1ca9ff 100644 --- a/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs +++ b/src/OpenFga.Sdk.Test/Api/OpenFgaApiTests.cs @@ -1514,7 +1514,6 @@ public async Task ListUsersTest() { } }, - ExcludedUsers = new List() }; mockHandler.Protected() .Setup>( diff --git a/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs b/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs index 6a8eae1..58be0d7 100644 --- a/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs +++ b/src/OpenFga.Sdk.Test/Client/OpenFgaClientTests.cs @@ -1464,7 +1464,6 @@ public async Task ListUsersTest() { } }, - ExcludedUsers = new List() }; mockHandler.Protected() .Setup>( diff --git a/src/OpenFga.Sdk/Api/OpenFgaApi.cs b/src/OpenFga.Sdk/Api/OpenFgaApi.cs index db98fe3..999759d 100644 --- a/src/OpenFga.Sdk/Api/OpenFgaApi.cs +++ b/src/OpenFga.Sdk/Api/OpenFgaApi.cs @@ -248,7 +248,7 @@ public async Task ListObjects(string storeId, ListObjectsRe } /// - /// [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type. The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. This API is available in an experimental capacity and can be enabled with the `- -experimentals enable-list-users` flag. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In certain cases of negation via the `but not` operator, some results are marked as excluded from the main set of results. These exclusions are returned in the `excluded_users` property and should be handled appropriately at the point of implementation.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users. + /// [EXPERIMENTAL] List the users matching the provided filter who have a certain relation to a particular type. The ListUsers API returns a list of all the users of a specific type that have a relation to a given object. This API is available in an experimental capacity and can be enabled with the `- -experimentals enable-list-users` flag. To arrive at a result, the API uses: an authorization model, explicit tuples written through the Write API, contextual tuples present in the request, and implicit tuples that exist by virtue of applying set theory (such as `document:2021-budget#viewer@document:2021-budget#viewer`; the set of users who are viewers of `document:2021-budget` are the set of users who are the viewers of `document:2021-budget`). An `authorization_model_id` may be specified in the body. If it is not specified, the latest authorization model ID will be used. It is strongly recommended to specify authorization model id for better performance. You may also specify `contextual_tuples` that will be treated as regular tuples. Each of these tuples may have an associated `condition`. You may also provide a `context` object that will be used to evaluate the conditioned tuples in the system. It is strongly recommended to provide a value for all the input parameters of all the conditions, to ensure that all tuples be evaluated correctly. The response will contain the related users in an array in the \"users\" field of the response. These results may include specific objects, usersets or type-bound public access. Each of these types of results is encoded in its own type and not represented as a string.In cases where a type-bound public acces result is returned (e.g. `user:*`), it cannot be inferred that all subjects of that type have a relation to the object; it is possible that negations exist and checks should still be queried on individual subjects to ensure access to that document.The number of users in the response array will be limited by the execution timeout specified in the flag OPENFGA_LIST_USERS_DEADLINE and by the upper bound specified in the flag OPENFGA_LIST_USERS_MAX_RESULTS, whichever is hit first. The returned users will not be sorted, and therefore two identical calls may yield different sets of users. /// /// Thrown when fails to make API call /// diff --git a/src/OpenFga.Sdk/Model/ListUsersResponse.cs b/src/OpenFga.Sdk/Model/ListUsersResponse.cs index e3a75e7..c92d3a8 100644 --- a/src/OpenFga.Sdk/Model/ListUsersResponse.cs +++ b/src/OpenFga.Sdk/Model/ListUsersResponse.cs @@ -34,18 +34,12 @@ public ListUsersResponse() { /// Initializes a new instance of the class. /// /// users (required). - /// excludedUsers (required). - public ListUsersResponse(List users = default(List), List excludedUsers = default(List)) { + public ListUsersResponse(List users = default(List)) { // to ensure "users" is required (not null) if (users == null) { throw new ArgumentNullException("users is a required property for ListUsersResponse and cannot be null"); } this.Users = users; - // to ensure "excludedUsers" is required (not null) - if (excludedUsers == null) { - throw new ArgumentNullException("excludedUsers is a required property for ListUsersResponse and cannot be null"); - } - this.ExcludedUsers = excludedUsers; this.AdditionalProperties = new Dictionary(); } @@ -57,14 +51,6 @@ public ListUsersResponse() { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public List Users { get; set; } - /// - /// Gets or Sets ExcludedUsers - /// - [DataMember(Name = "excluded_users", IsRequired = true, EmitDefaultValue = false)] - [JsonPropertyName("excluded_users")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public List ExcludedUsers { get; set; } - /// /// Gets or Sets additional properties /// @@ -112,12 +98,6 @@ public bool Equals(ListUsersResponse input) { this.Users != null && input.Users != null && this.Users.SequenceEqual(input.Users) - ) && - ( - this.ExcludedUsers == input.ExcludedUsers || - this.ExcludedUsers != null && - input.ExcludedUsers != null && - this.ExcludedUsers.SequenceEqual(input.ExcludedUsers) ) && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); } @@ -133,9 +113,6 @@ public override int GetHashCode() { if (this.Users != null) { hashCode = (hashCode * 9923) + this.Users.GetHashCode(); } - if (this.ExcludedUsers != null) { - hashCode = (hashCode * 9923) + this.ExcludedUsers.GetHashCode(); - } if (this.AdditionalProperties != null) { hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); } diff --git a/src/OpenFga.Sdk/Model/ObjectOrUserset.cs b/src/OpenFga.Sdk/Model/ObjectOrUserset.cs deleted file mode 100644 index ce7eff9..0000000 --- a/src/OpenFga.Sdk/Model/ObjectOrUserset.cs +++ /dev/null @@ -1,147 +0,0 @@ -// -// 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.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace OpenFga.Sdk.Model { - /// - /// ObjectOrUserset - /// - [DataContract(Name = "ObjectOrUserset")] - public partial class ObjectOrUserset : IEquatable, IValidatableObject { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructor] - public ObjectOrUserset() { - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Initializes a new instance of the class. - /// - /// _object. - /// userset. - public ObjectOrUserset(FgaObject _object = default(FgaObject), UsersetUser userset = default(UsersetUser)) { - this.Object = _object; - this.Userset = userset; - this.AdditionalProperties = new Dictionary(); - } - - /// - /// Gets or Sets Object - /// - [DataMember(Name = "object", EmitDefaultValue = false)] - [JsonPropertyName("object")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public FgaObject? Object { get; set; } - - /// - /// Gets or Sets Userset - /// - [DataMember(Name = "userset", EmitDefaultValue = false)] - [JsonPropertyName("userset")] - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public UsersetUser? Userset { get; set; } - - /// - /// Gets or Sets additional properties - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() { - return JsonSerializer.Serialize(this); - } - - /// - /// Builds a ObjectOrUserset from the JSON string presentation of the object - /// - /// ObjectOrUserset - public static ObjectOrUserset FromJson(string jsonString) { - return JsonSerializer.Deserialize(jsonString) ?? throw new InvalidOperationException(); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) { - return this.Equals(input as ObjectOrUserset); - } - - /// - /// Returns true if ObjectOrUserset instances are equal - /// - /// Instance of ObjectOrUserset to be compared - /// Boolean - public bool Equals(ObjectOrUserset input) { - if (input == null) { - return false; - } - return - ( - this.Object == input.Object || - (this.Object != null && - this.Object.Equals(input.Object)) - ) && - ( - this.Userset == input.Userset || - (this.Userset != null && - this.Userset.Equals(input.Userset)) - ) - && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any()); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() { - unchecked // Overflow is fine, just wrap - { - int hashCode = 9661; - if (this.Object != null) { - hashCode = (hashCode * 9923) + this.Object.GetHashCode(); - } - if (this.Userset != null) { - hashCode = (hashCode * 9923) + this.Userset.GetHashCode(); - } - if (this.AdditionalProperties != null) { - hashCode = (hashCode * 9923) + this.AdditionalProperties.GetHashCode(); - } - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - public IEnumerable Validate(ValidationContext validationContext) { - yield break; - } - - } - -} \ No newline at end of file