Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: oneOf in sessions #339

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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