You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openfga/v1/openfga_service.proto
+21-24Lines changed: 21 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -155,8 +155,9 @@ service OpenFGAService {
155
155
"relationship exists between an object and an user.\n"
156
156
"In the body, `writes` adds new tuples and `deletes` removes existing tuples. When deleting a tuple, any `condition` specified with it is ignored.\n"
157
157
"The API is not idempotent by default: if, later on, you try to add the same tuple key (even if the `condition` is different), or if you try to delete a non-existing tuple, it will throw an error.\n"
158
-
"To allow writes when an identical tuple already exists in the database, set `\"on_duplicate\": \"ON_DUPLICATE_IGNORE\"` on the `writes` object.\n"
159
-
"To allow deletes when a tuple was already removed from the database, set `\"on_missing\": \"ON_MISSING_IGNORE\"` on the `deletes` object.\n"
158
+
"To allow writes when an identical tuple already exists in the database, set `\"on_duplicate\": \"ignore\"` on the `writes` object.\n"
159
+
"To allow deletes when a tuple was already removed from the database, set `\"on_missing\": \"ignore\"` on the `deletes` object.\n"
160
+
"If a Write request contains both idempotent (ignore) and non-idempotent (error) operations, the most restrictive action (error) will take precedence. If a condition fails for a sub-request with an error flag, the entire transaction will be rolled back. This gives developers explicit control over the atomicity of the requests.\n"
160
161
"The API will not allow you to write tuples such as `document:2021-budget#viewer@document:2021-budget#viewer`, because they are implicit.\n"
161
162
"An `authorization_model_id` may be specified in the body. If it is, it will be used to assert that each written tuple (not deleted) "
162
163
"is valid for the model specified. If it is not specified, the latest authorization model ID will be used.\n"
description: "If 'ON_DUPLICATE_ERROR', the API returns an error if an identical tuple already exists. If 'ON_DUPLICATE_IGNORE', identical writes are treated as no-ops (matching on user, relation, object, and RelationshipCondition)."
1259
+
enum: [
1260
+
"error", // Return an error if a tuple already exists.
1261
+
"ignore" // Treat identical writes as no-ops if all attributes (including the RelationshipCondition) match.
1262
+
]
1263
+
default: "error"
1264
+
example: "\"ignore\""
1265
+
description: "On 'error' ( or unspecified ), the API returns an error if an identical tuple already exists. On 'ignore', identical writes are treated as no-ops (matching on user, relation, object, and RelationshipCondition)."
1267
1266
}
1268
1267
];
1269
1268
}
1270
1269
1271
-
enumOnMissing {
1272
-
ON_MISSING_UNSPECIFIED=0; // If set to 'ON_MISSING_UNSPECIFIED' or not set, the API behaves as if it were set to 'ON_MISSING_ERROR'.
1273
-
ON_MISSING_ERROR=1; // Return an error if a tuple does not exist.
1274
-
ON_MISSING_IGNORE=2; // Do not return an error if a tuple does not exist.
description: "If 'ON_MISSING_ERROR', the API returns an error when deleting a tuple that does not exist. If 'ON_MISSING_IGNORE', deletes of non-existent tuples are treated as no-ops."
1280
+
enum: [
1281
+
"error", // Return an error if a tuple does not exist.
1282
+
"ignore" // Do not return an error if a tuple does not exist.
1283
+
]
1284
+
default: "error"
1285
+
example: "\"ignore\""
1286
+
description: "On 'error', the API returns an error when deleting a tuple that does not exist. On 'ignore', deletes of non-existent tuples are treated as no-ops."
0 commit comments