-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust/java/node/python): Use enums for types with limited values …
…for better type inference on caller side (#33)
- Loading branch information
Showing
12 changed files
with
178 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
flipt-java/src/main/java/io/flipt/api/evaluation/models/ErrorEvaluationReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.flipt.api.evaluation.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum ErrorEvaluationReason { | ||
UNKNOWN_ERROR_EVALUATION_REASON("UNKNOWN_ERROR_EVALUATION_REASON"), | ||
|
||
NOT_FOUND_ERROR_EVALUATION_REASON("NOT_FOUND_ERROR_EVALUATION_REASON"); | ||
|
||
private final String value; | ||
|
||
ErrorEvaluationReason(String value) { | ||
this.value = value; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
flipt-java/src/main/java/io/flipt/api/evaluation/models/EvaluationReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.flipt.api.evaluation.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum EvaluationReason { | ||
UNKNOWN_EVALUATION_REASON("UNKNOWN_EVALUATION_REASON"), | ||
|
||
FLAG_DISABLED_EVALUATION_REASON("FLAG_DISABLED_EVALUATION_REASON"), | ||
|
||
MATCH_EVALUATION_REASON("MATCH_EVALUATION_REASON"), | ||
|
||
DEFAULT_EVALUATION_REASON("DEFAULT_EVALUATION_REASON"); | ||
|
||
private final String value; | ||
|
||
EvaluationReason(String value) { | ||
this.value = value; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
flipt-java/src/main/java/io/flipt/api/evaluation/models/EvaluationResponseType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.flipt.api.evaluation.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
public enum EvaluationResponseType { | ||
VARIANT_EVALUATION_RESPONSE_TYPE("VARIANT_EVALUATION_RESPONSE_TYPE"), | ||
|
||
BOOLEAN_EVALUATION_RESPONSE_TYPE("BOOLEAN_EVALUATION_RESPONSE_TYPE"), | ||
|
||
ERROR_EVALUATION_RESPONSE_TYPE("ERROR_EVALUATION_RESPONSE_TYPE"); | ||
|
||
private final String value; | ||
|
||
EvaluationResponseType(String value) { | ||
this.value = value; | ||
} | ||
|
||
@JsonValue | ||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.