Skip to content

Commit

Permalink
fix: oneof
Browse files Browse the repository at this point in the history
  • Loading branch information
esoubiran-aneo committed Jul 11, 2023
1 parent f146d04 commit 19dc7ef
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
51 changes: 31 additions & 20 deletions Protos/V1/sessions_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,42 @@ message SessionRaw {
/**
* Represents every available field in a session raw.
*/
enum SessionRawField {
SESSION_RAW_FIELD_UNSPECIFIED = 0;
SESSION_RAW_FIELD_SESSION_ID = 1;
SESSION_RAW_FIELD_STATUS = 2;
SESSION_RAW_FIELD_PARTITION_IDS = 3;
SESSION_RAW_FIELD_OPTIONS = 4;
SESSION_RAW_FIELD_CREATED_AT = 5;
SESSION_RAW_FIELD_CANCELLED_AT = 6;
SESSION_RAW_FIELD_DURATION = 7;
enum SessionRawEnumField {
SESSION_RAW_ENUM_FIELD_UNSPECIFIED = 0;
SESSION_RAW_ENUM_FIELD_SESSION_ID = 1;
SESSION_RAW_ENUM_FIELD_STATUS = 2;
SESSION_RAW_ENUM_FIELD_PARTITION_IDS = 3;
SESSION_RAW_ENUM_FIELD_OPTIONS = 4;
SESSION_RAW_ENUM_FIELD_CREATED_AT = 5;
SESSION_RAW_ENUM_FIELD_CANCELLED_AT = 6;
SESSION_RAW_ENUM_FIELD_DURATION = 7;
}

message SessionRawField {
SessionRawEnumField field = 1;
}

/**
* Represents a field in a task option.
*/
enum TaskOptionField {
TASK_OPTION_FIELD_UNSPECIFIED = 0;
TASK_OPTION_FIELD_MAX_DURATION = 1;
TASK_OPTION_FIELD_MAX_RETRIES = 2;
TASK_OPTION_FIELD_PRIORITY = 3;
TASK_OPTION_FIELD_PARTITION_ID = 4;
TASK_OPTION_FIELD_APPLICATION_NAME = 5;
TASK_OPTION_FIELD_APPLICATION_VERSION = 6;
TASK_OPTION_FIELD_APPLICATION_NAMESPACE = 7;
TASK_OPTION_FIELD_APPLICATION_SERVICE = 8;
TASK_OPTION_FIELD_ENGINE_TYPE = 9;
enum TaskOptionEnumField {
TASK_OPTION_ENUM_FIELD_UNSPECIFIED = 0;
TASK_OPTION_ENUM_FIELD_MAX_DURATION = 1;
TASK_OPTION_ENUM_FIELD_MAX_RETRIES = 2;
TASK_OPTION_ENUM_FIELD_PRIORITY = 3;
TASK_OPTION_ENUM_FIELD_PARTITION_ID = 4;
TASK_OPTION_ENUM_FIELD_APPLICATION_NAME = 5;
TASK_OPTION_ENUM_FIELD_APPLICATION_VERSION = 6;
TASK_OPTION_ENUM_FIELD_APPLICATION_NAMESPACE = 7;
TASK_OPTION_ENUM_FIELD_APPLICATION_SERVICE = 8;
TASK_OPTION_ENUM_FIELD_ENGINE_TYPE = 9;
}

/**
* This message is used to wrap the enum in order to facilitate the 'oneOf' generation.
*/
message TaskOptionField {
TaskOptionEnumField field = 1;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export {
CountTasksByStatusRequest as CountTasksByStatusSessionRequest,
CountTasksByStatusResponse as CountTasksByStatusSessionResponse,
SessionRaw,
SessionRawEnumField,
SessionRawField,
TaskOptionEnumField as SessionTaskOptionEnumField,
TaskOptionField as SessionTaskOptionField,
TaskOptionGenericField as SessionTaskOptionGenericField,
SessionField
} from "./generated/sessions-common.pb";
export { SessionsClient } from "./generated/sessions-service.pbsc";
Expand Down

0 comments on commit 19dc7ef

Please sign in to comment.