syntax = "proto3";

package flipt;

import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "gnostic/openapi/v3/annotations.proto";
import "options/options.proto";

option go_package = "go.flipt.io/flipt/rpc/flipt";

message EvaluationRequest {
  string request_id = 1;
  string flag_key = 2;
  string entity_id = 3;
  map<string, string> context = 4;
  string namespace_key = 5;
}

message BatchEvaluationRequest {
  string request_id = 1;
  repeated EvaluationRequest requests = 2;
  bool exclude_not_found = 3;
  string namespace_key = 4;
}

message BatchEvaluationResponse {
  string request_id = 1;
  repeated EvaluationResponse responses = 2;
  double request_duration_millis = 3;
}

message EvaluationResponse {
  string request_id = 1;
  string entity_id = 2;
  map<string, string> request_context = 3;
  bool match = 4;
  string flag_key = 5;
  string segment_key = 6 [deprecated = true];
  google.protobuf.Timestamp timestamp = 7;
  string value = 8;
  double request_duration_millis = 9;
  string attachment = 10;
  EvaluationReason reason = 11;
  string namespace_key = 12;
  repeated string segment_keys = 13;
}

enum EvaluationReason {
  UNKNOWN_EVALUATION_REASON = 0;
  FLAG_DISABLED_EVALUATION_REASON = 1;
  FLAG_NOT_FOUND_EVALUATION_REASON = 2;
  MATCH_EVALUATION_REASON = 3;
  ERROR_EVALUATION_REASON = 4;
  DEFAULT_EVALUATION_REASON = 5;
}

message Namespace {
  string key = 1;
  string name = 2;
  string description = 3;
  bool protected = 4;
  google.protobuf.Timestamp created_at = 5;
  google.protobuf.Timestamp updated_at = 6;
}

message NamespaceList {
  repeated Namespace namespaces = 1;
  string next_page_token = 2;
  int32 total_count = 3;
}

message GetNamespaceRequest {
  string key = 1;
  string reference = 2;
}

message ListNamespaceRequest {
  int32 limit = 1;
  int32 offset = 2 [deprecated = true];
  string page_token = 3;
  string reference = 4;
}

message CreateNamespaceRequest {
  string key = 1 [(google.api.field_behavior) = REQUIRED];
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
}

message UpdateNamespaceRequest {
  string key = 1;
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
}

message DeleteNamespaceRequest {
  string key = 1;
  bool force = 2;
}

enum FlagType {
  VARIANT_FLAG_TYPE = 0;
  BOOLEAN_FLAG_TYPE = 1;
}

message Flag {
  string key = 1;
  string name = 2;
  string description = 3;
  bool enabled = 4;
  google.protobuf.Timestamp created_at = 5;
  google.protobuf.Timestamp updated_at = 6;
  repeated Variant variants = 7;
  string namespace_key = 8;
  FlagType type = 9;
  optional Variant default_variant = 10;
  optional google.protobuf.Struct metadata = 11;
 }

message FlagList {
  repeated Flag flags = 1;
  string next_page_token = 2;
  int32 total_count = 3;
}

message GetFlagRequest {
  string key = 1;
  string namespace_key = 2;
  string reference = 3;
}

message ListFlagRequest {
  int32 limit = 1;
  int32 offset = 2 [deprecated = true];
  string page_token = 3;
  string namespace_key = 4;
  string reference = 5;
}

message CreateFlagRequest {
  string key = 1 [(google.api.field_behavior) = REQUIRED];
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
  bool enabled = 4;
  string namespace_key = 5;
  FlagType type = 6 [(google.api.field_behavior) = REQUIRED];
  optional google.protobuf.Struct metadata = 7;
}

message UpdateFlagRequest {
  string key = 1;
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
  bool enabled = 4;
  string namespace_key = 5;
  string default_variant_id = 6;
  optional google.protobuf.Struct metadata = 7;
}

message DeleteFlagRequest {
  string key = 1;
  string namespace_key = 2;
}

message Variant {
  string id = 1;
  string flag_key = 2;
  string key = 3;
  string name = 4;
  string description = 5;
  google.protobuf.Timestamp created_at = 6;
  google.protobuf.Timestamp updated_at = 7;
  string attachment = 8;
  string namespace_key = 9;
}

message CreateVariantRequest {
  string flag_key = 1;
  string key = 2 [(google.api.field_behavior) = REQUIRED];
  string name = 3;
  string description = 4;
  string attachment = 5;
  string namespace_key = 6;
}

message UpdateVariantRequest {
  string id = 1;
  string flag_key = 2;
  string key = 3 [(google.api.field_behavior) = REQUIRED];
  string name = 4;
  string description = 5;
  string attachment = 6;
  string namespace_key = 7;
}

message DeleteVariantRequest {
  string id = 1;
  string flag_key = 2;
  string namespace_key = 3;
}

enum MatchType {
  ALL_MATCH_TYPE = 0;
  ANY_MATCH_TYPE = 1;
}

message Segment {
  string key = 1;
  string name = 2;
  string description = 3;
  google.protobuf.Timestamp created_at = 4;
  google.protobuf.Timestamp updated_at = 5;
  repeated Constraint constraints = 6;
  MatchType match_type = 7;
  string namespace_key = 8;
}

message SegmentList {
  repeated Segment segments = 1;
  string next_page_token = 2;
  int32 total_count = 3;
}

message GetSegmentRequest {
  string key = 1;
  string namespace_key = 2;
  string reference = 3;
}

message ListSegmentRequest {
  int32 limit = 1;
  int32 offset = 2 [deprecated = true];
  string page_token = 3;
  string namespace_key = 4;
  string reference = 5;
}

message CreateSegmentRequest {
  string key = 1 [(google.api.field_behavior) = REQUIRED];
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
  MatchType match_type = 4 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 5;
}

message UpdateSegmentRequest {
  string key = 1;
  string name = 2 [(google.api.field_behavior) = REQUIRED];
  string description = 3;
  MatchType match_type = 4 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 5;
}

message DeleteSegmentRequest {
  string key = 1;
  string namespace_key = 2;
}

enum ComparisonType {
  UNKNOWN_COMPARISON_TYPE = 0;
  STRING_COMPARISON_TYPE = 1;
  NUMBER_COMPARISON_TYPE = 2;
  BOOLEAN_COMPARISON_TYPE = 3;
  DATETIME_COMPARISON_TYPE = 4;
  ENTITY_ID_COMPARISON_TYPE = 5;
}

message Constraint {
  string id = 1;
  string segment_key = 2;
  ComparisonType type = 3;
  string property = 4;
  string operator = 5;
  string value = 6;
  google.protobuf.Timestamp created_at = 7;
  google.protobuf.Timestamp updated_at = 8;
  string namespace_key = 9;
  string description = 10;
}

message CreateConstraintRequest {
  string segment_key = 1;
  ComparisonType type = 2 [(google.api.field_behavior) = REQUIRED];
  string property = 3 [(google.api.field_behavior) = REQUIRED];
  string operator = 4 [(google.api.field_behavior) = REQUIRED];
  string value = 5;
  string namespace_key = 6;
  string description = 7;
}

message UpdateConstraintRequest {
  string id = 1;
  string segment_key = 2;
  ComparisonType type = 3 [(google.api.field_behavior) = REQUIRED];
  string property = 4 [(google.api.field_behavior) = REQUIRED];
  string operator = 5 [(google.api.field_behavior) = REQUIRED];
  string value = 6;
  string namespace_key = 7;
  string description = 8;
}

message DeleteConstraintRequest {
  string id = 1;
  string segment_key = 2;
  string namespace_key = 3;
}

enum RolloutType {
  UNKNOWN_ROLLOUT_TYPE = 0;
  SEGMENT_ROLLOUT_TYPE = 1;
  THRESHOLD_ROLLOUT_TYPE = 2;
}

enum SegmentOperator {
  OR_SEGMENT_OPERATOR = 0;
  AND_SEGMENT_OPERATOR = 1;
}

message Rollout {
  string id = 1;
  string namespace_key = 2;
  string flag_key = 3;
  RolloutType type = 4;
  int32 rank = 5;
  string description = 6;
  google.protobuf.Timestamp created_at = 7;
  google.protobuf.Timestamp updated_at = 8;
  oneof rule {
    RolloutSegment segment = 20;
    RolloutThreshold threshold = 21;
  }
}

message RolloutSegment {
  string segment_key = 1 [deprecated = true];
  bool value = 2;
  repeated string segment_keys = 3;
  SegmentOperator segment_operator = 4;
}

message RolloutThreshold {
  float percentage = 1;
  bool value = 2;
}

message RolloutList {
  repeated Rollout rules = 1;
  string next_page_token = 2;
  int32 total_count = 3;
}

message ListRolloutRequest {
  string namespace_key = 1;
  string flag_key = 2;
  int32 limit = 3;
  string page_token = 4;
  string reference = 5;
}

message GetRolloutRequest {
  string id = 1;
  string namespace_key = 2;
  string flag_key = 3;
  string reference = 4;
}

message CreateRolloutRequest {
  string namespace_key = 1;
  string flag_key = 2;
  int32 rank = 3 [(google.api.field_behavior) = REQUIRED];
  string description = 4;
  oneof rule {
    RolloutSegment segment = 20;
    RolloutThreshold threshold = 21;
  }
}

message UpdateRolloutRequest {
  string id = 1;
  string namespace_key = 2;
  string flag_key = 3;
  string description = 4;
  oneof rule {
    RolloutSegment segment = 20;
    RolloutThreshold threshold = 21;
  }
}

message DeleteRolloutRequest {
  string id = 1;
  string namespace_key = 2;
  string flag_key = 3;
}

message OrderRolloutsRequest {
  string flag_key = 1;
  string namespace_key = 2;
  repeated string rollout_ids = 3 [(google.api.field_behavior) = REQUIRED];
}

message Rule {
  string id = 1;
  string flag_key = 2;
  string segment_key = 3;
  repeated Distribution distributions = 4;
  int32 rank = 5;
  google.protobuf.Timestamp created_at = 6;
  google.protobuf.Timestamp updated_at = 7;
  string namespace_key = 8;
  repeated string segment_keys = 9;
  SegmentOperator segment_operator = 10;
}

message RuleList {
  repeated Rule rules = 1;
  string next_page_token = 2;
  int32 total_count = 3;
}

message ListRuleRequest {
  int32 limit = 1;
  int32 offset = 2 [deprecated = true];
  string flag_key = 3;
  string page_token = 4;
  string namespace_key = 5;
  string reference = 6;
}

message GetRuleRequest {
  string id = 1;
  string flag_key = 2;
  string namespace_key = 3;
  string reference = 4;
}

message CreateRuleRequest {
  string flag_key = 1;
  string segment_key = 2 [deprecated = true];
  int32 rank = 3 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 4;
  repeated string segment_keys = 5;
  SegmentOperator segment_operator = 6;
}

message UpdateRuleRequest {
  string id = 1;
  string flag_key = 2;
  string segment_key = 3 [deprecated = true];
  string namespace_key = 4;
  repeated string segment_keys = 5;
  SegmentOperator segment_operator = 6;
}

message DeleteRuleRequest {
  string id = 1;
  string flag_key = 2;
  string namespace_key = 3;
}

message OrderRulesRequest {
  string flag_key = 1;
  repeated string rule_ids = 2 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 3;
}

message Distribution {
  string id = 1;
  string rule_id = 2;
  string variant_id = 3;
  float rollout = 4;
  google.protobuf.Timestamp created_at = 5;
  google.protobuf.Timestamp updated_at = 6;
}

message CreateDistributionRequest {
  string flag_key = 1;
  string rule_id = 2;
  string variant_id = 3 [(google.api.field_behavior) = REQUIRED];
  float rollout = 4 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 5;
}

message UpdateDistributionRequest {
  string id = 1;
  string flag_key = 2;
  string rule_id = 3;
  string variant_id = 4 [(google.api.field_behavior) = REQUIRED];
  float rollout = 5 [(google.api.field_behavior) = REQUIRED];
  string namespace_key = 6;
}

message DeleteDistributionRequest {
  string id = 1;
  string flag_key = 2;
  string rule_id = 3;
  string variant_id = 4;
  string namespace_key = 5;
}

service Flipt {
  rpc Evaluate(EvaluationRequest) returns (EvaluationResponse) {
    option deprecated = true;
  }
  rpc BatchEvaluate(BatchEvaluationRequest) returns (BatchEvaluationResponse) {
    option deprecated = true;
  }
  rpc GetNamespace(GetNamespaceRequest) returns (Namespace) {
    option (google.api.http) = {get: "/api/v1/namespaces/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "getNamespace" tags: ["NamespacesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "key", value: "default"}};
  }
  rpc ListNamespaces(ListNamespaceRequest) returns (NamespaceList) {
    option (google.api.http) = {get: "/api/v1/namespaces"};
    option (gnostic.openapi.v3.operation) = {operation_id: "listNamespaces" tags: ["NamespacesService"]};
  }
  rpc CreateNamespace(CreateNamespaceRequest) returns (Namespace) {
    option (google.api.http) = {post: "/api/v1/namespaces" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createNamespace" tags: ["NamespacesService"]};
  }
  rpc UpdateNamespace(UpdateNamespaceRequest) returns (Namespace) {
    option (google.api.http) = {put: "/api/v1/namespaces/{key}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateNamespace" tags: ["NamespacesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "key", value: "default"}};
  }
  rpc DeleteNamespace(DeleteNamespaceRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteNamespace" tags: ["NamespacesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "key", value: "default"}};
  }
  rpc GetFlag(GetFlagRequest) returns (Flag) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "getFlag" tags: ["FlagsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc ListFlags(ListFlagRequest) returns (FlagList) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags"};
    option (gnostic.openapi.v3.operation) = {operation_id: "listFlags" tags: ["FlagsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateFlag(CreateFlagRequest) returns (Flag) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/flags" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createFlag" tags: ["FlagsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateFlag(UpdateFlagRequest) returns (Flag) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{key}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateFlag" tags: ["FlagsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteFlag(DeleteFlagRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/flags/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteFlag" tags: ["FlagsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateVariant(CreateVariantRequest) returns (Variant) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/variants" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createVariant" tags: ["VariantsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateVariant(UpdateVariantRequest) returns (Variant) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/variants/{id}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateVariant" tags: ["VariantsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteVariant(DeleteVariantRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/variants/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteVariant" tags: ["VariantsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc GetRule(GetRuleRequest) returns (Rule) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "getRule" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc ListRules(ListRuleRequest) returns (RuleList) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules"};
    option (gnostic.openapi.v3.operation) = {operation_id: "listRules" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateRule(CreateRuleRequest) returns (Rule) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createRule" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateRule(UpdateRuleRequest) returns (Rule) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{id}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateRule" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc OrderRules(OrderRulesRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/order" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "orderRules" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteRule(DeleteRuleRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteRule" tags: ["RulesService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc GetRollout(GetRolloutRequest) returns (Rollout) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "getRollout" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc ListRollouts(ListRolloutRequest) returns (RolloutList) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts"};
    option (gnostic.openapi.v3.operation) = {operation_id: "listRollouts" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateRollout(CreateRolloutRequest) returns (Rollout) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createRollout" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateRollout(UpdateRolloutRequest) returns (Rollout) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/{id}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateRollout" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteRollout(DeleteRolloutRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteRollout" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc OrderRollouts(OrderRolloutsRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rollouts/order" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "orderRollouts" tags: ["RolloutsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateDistribution(CreateDistributionRequest) returns (Distribution) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{rule_id}/distributions" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createDistribution" tags: ["DistributionsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateDistribution(UpdateDistributionRequest) returns (Distribution) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{rule_id}/distributions/{id}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateDistribution" tags: ["DistributionsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteDistribution(DeleteDistributionRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/flags/{flag_key}/rules/{rule_id}/distributions/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteDistribution" tags: ["DistributionsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc GetSegment(GetSegmentRequest) returns (Segment) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/segments/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "getSegment" tags: ["SegmentsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc ListSegments(ListSegmentRequest) returns (SegmentList) {
    option (google.api.http) = {get: "/api/v1/namespaces/{namespace_key}/segments"};
    option (gnostic.openapi.v3.operation) = {operation_id: "listSegments" tags: ["SegmentsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateSegment(CreateSegmentRequest) returns (Segment) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/segments" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createSegment" tags: ["SegmentsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateSegment(UpdateSegmentRequest) returns (Segment) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/segments/{key}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateSegment" tags: ["SegmentsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteSegment(DeleteSegmentRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/segments/{key}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteSegment" tags: ["SegmentsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc CreateConstraint(CreateConstraintRequest) returns (Constraint) {
    option (google.api.http) = {post: "/api/v1/namespaces/{namespace_key}/segments/{segment_key}/constraints" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "createConstraint" tags: ["ConstraintsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc UpdateConstraint(UpdateConstraintRequest) returns (Constraint) {
    option (google.api.http) = {put: "/api/v1/namespaces/{namespace_key}/segments/{segment_key}/constraints/{id}" body: "*"};
    option (gnostic.openapi.v3.operation) = {operation_id: "updateConstraint" tags: ["ConstraintsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
  rpc DeleteConstraint(DeleteConstraintRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = {delete: "/api/v1/namespaces/{namespace_key}/segments/{segment_key}/constraints/{id}"};
    option (gnostic.openapi.v3.operation) = {operation_id: "deleteConstraint" tags: ["ConstraintsService"]};
    option (flipt.options.flipt_client) = {path_defaults: {key: "namespace_key", value: "default"}};
  }
}
