Skip to content

Commit

Permalink
Wrap types to prepare for the Any type
Browse files Browse the repository at this point in the history
  • Loading branch information
andronat committed Oct 3, 2024
1 parent de24fd2 commit 94a23b7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 21 deletions.
1 change: 0 additions & 1 deletion proto/relay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ message RelayPayload {
self_serve.orb.v1.AgeVerificationRequiredFromOperator age_verification_required_from_operator = 14;
self_serve.app.v1.StartCapture start_capture = 15;
self_serve.app.v1.RequestState request_state = 16;
self_serve.orb.v1.SelfServeStatus self_serve_status = 17;
self_serve.orb.v1.NoState no_state = 18;
self_serve.orb.v1.CaptureTriggerTimeout capture_trigger_timeout = 19;

Expand Down
10 changes: 10 additions & 0 deletions proto/self_serve/app/v1/app.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ syntax = "proto3";

package self_serve.app.v1;

// Wrapper message for all messages that can be sent to and from the app. The reason we do this is to ensure static
// typing in the clients while the server can still handle all messages through the Any type.
message W {
oneof w {
StartCapture start_capture = 1;
RequestState request_state = 2;
AbortSignup abort_signup = 3;
}
}

message StartCapture {}
message RequestState {}
message AbortSignup {}
64 changes: 44 additions & 20 deletions proto/self_serve/orb/v1/orb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,65 @@ syntax = "proto3";

package self_serve.orb.v1;

message NoState {}
message SelfServeStatus {
bool is_self_serve_enabled = 1;
// Wrapper message for all messages that can be sent to and from the orb. The reason we do this is to ensure static
// typing in the clients while the server can still handle all messages through the Any type.
message W {
oneof w {
NoState no_state = 1;
AnnounceOrbId announce_orb_id = 2;
CaptureStarted capture_started = 3;
CaptureTriggerTimeout capture_trigger_timeout = 4;
CaptureEnded capture_ended = 5;
SignupEnded signup_ended = 6;
AgeVerificationRequiredFromOperator age_verification_required_from_operator = 7;
}
}

message NoState {}
message AnnounceOrbId {
enum ModeType {
MODE_TYPE_UNSPECIFIED = 0;
MODE_TYPE_LEGACY = 1;
MODE_TYPE_SELF_SERVE = 2;
}

enum HardwareType {
HARDWARE_TYPE_UNSPECIFIED = 0;
HARDWARE_TYPE_PEARL = 1;
HARDWARE_TYPE_DIAMOND = 2;
}

string orb_id = 1;
bool is_self_serve_enabled = 2;
ModeType mode_type = 2;
HardwareType hardware_type = 3;
}
message CaptureStarted {}
message CaptureTriggerTimeout {}
message CaptureEnded {
enum FailureFeedbackType {
UNKNOWN = 0;
FACE_OCCLUSION_OR_POOR_LIGHTING = 1;
TOO_FAR = 2;
TOO_CLOSE = 3;
EYES_OCCLUSION = 4;
FAILURE_FEEDBACK_TYPE_UNSPECIFIED = 0;
FAILURE_FEEDBACK_TYPE_FACE_OCCLUSION_OR_POOR_LIGHTING = 1;
FAILURE_FEEDBACK_TYPE_TOO_FAR = 2;
FAILURE_FEEDBACK_TYPE_TOO_CLOSE = 3;
FAILURE_FEEDBACK_TYPE_EYES_OCCLUSION = 4;
}

bool success = 1;
repeated FailureFeedbackType failure_feedback = 2;
}
message SignupEnded {
enum FailureFeedbackType {
UNKNOWN = 0;
CONTACT_LENSES = 1;
EYE_GLASSES = 2;
MASK = 3;
FACE_OCCLUSION = 4;
MULTIPLE_FACES = 5;
EYES_OCCLUSION = 6;
HEAD_POSE = 7;
UNDERAGED = 8;
SERVER_ERROR = 9;
LOW_IMAGE_QUALITY = 10;
FAILURE_FEEDBACK_TYPE_UNSPECIFIED = 0;
FAILURE_FEEDBACK_TYPE_CONTACT_LENSES = 1;
FAILURE_FEEDBACK_TYPE_EYE_GLASSES = 2;
FAILURE_FEEDBACK_TYPE_MASK = 3;
FAILURE_FEEDBACK_TYPE_FACE_OCCLUSION = 4;
FAILURE_FEEDBACK_TYPE_MULTIPLE_FACES = 5;
FAILURE_FEEDBACK_TYPE_EYES_OCCLUSION = 6;
FAILURE_FEEDBACK_TYPE_HEAD_POSE = 7;
FAILURE_FEEDBACK_TYPE_UNDERAGED = 8;
FAILURE_FEEDBACK_TYPE_SERVER_ERROR = 9;
FAILURE_FEEDBACK_TYPE_LOW_IMAGE_QUALITY = 10;
}

bool success = 1;
Expand Down

0 comments on commit 94a23b7

Please sign in to comment.