Skip to content

Commit

Permalink
move consistency enum to its own proto file; allows linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Sep 5, 2024
1 parent 55257aa commit 22d0df3
Show file tree
Hide file tree
Showing 6 changed files with 2,495 additions and 2,360 deletions.
4 changes: 2 additions & 2 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lint:
- openfga/v1/errors_ignore.proto
ENUM_VALUE_PREFIX:
- openfga/v1/errors_ignore.proto
- openfga/v1/openfga_service.proto
- openfga/v1/openfga_service_consistency.proto
ENUM_ZERO_VALUE_SUFFIX:
- openfga/v1/errors_ignore.proto
- openfga/v1/openfga_service.proto
- openfga/v1/openfga_service_consistency.proto
11 changes: 1 addition & 10 deletions openfga/v1/openfga_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "openfga/v1/authzmodel.proto";
import "openfga/v1/openfga.proto";
import "openfga/v1/openfga_service_consistency.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "validate/validate.proto";

Expand Down Expand Up @@ -786,16 +787,6 @@ service OpenFGAService {
}
}

// Controls the consistency preferences when calling the query APIs.
enum ConsistencyPreference {
// Default if not set. Behavior will be the same as MINIMIZE_LATENCY.
UNSPECIFIED = 0;
// Minimize latency at the potential expense of lower consistency.
MINIMIZE_LATENCY = 100;
// Prefer higher consistency, at the potential expense of increased latency.
HIGHER_CONSISTENCY = 200;
}

message ListObjectsRequest {
string store_id = 1 [
json_name = "store_id",
Expand Down
13 changes: 13 additions & 0 deletions openfga/v1/openfga_service_consistency.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package openfga.v1;

// Controls the consistency preferences when calling the query APIs.
enum ConsistencyPreference {
// Default if not set. Behavior will be the same as MINIMIZE_LATENCY.
UNSPECIFIED = 0;
// Minimize latency at the potential expense of lower consistency.
MINIMIZE_LATENCY = 100;
// Prefer higher consistency, at the potential expense of increased latency.
HIGHER_CONSISTENCY = 200;
}
Loading

0 comments on commit 22d0df3

Please sign in to comment.