Hi all.
I am moving an application to call a protobuff version 3 endpoint which has recently upgraded from v2.
In the past I had the following as an example:
proto:
message AppRequest {
required uint32 seq = 1;
required uint64 playerId = 2;
required int32 playerToken = 3;
optional uint32 entityId = 4;
optional AppEmpty getInfo = 8;
optional AppEmpty getTime = 9;
optional AppEmpty getMap = 10;
optional AppEmpty getTeamInfo = 11;
optional AppEmpty getTeamChat = 12;
optional AppSendMessage sendTeamMessage = 13;
optional AppEmpty getEntityInfo = 14;
optional AppSetEntityValue setEntityValue = 15;
optional AppEmpty checkSubscription = 16;
optional AppFlag setSubscription = 17;
optional AppEmpty getMapMarkers = 18;
optional AppPromoteToLeader promoteToLeader = 20;
optional AppEmpty getClanInfo = 21;
optional AppSendMessage setClanMotd = 22;
optional AppEmpty getClanChat = 23;
optional AppSendMessage sendClanMessage = 24;
optional AppGetNexusAuth getNexusAuth = 25;
optional AppCameraSubscribe cameraSubscribe = 30;
optional AppEmpty cameraUnsubscribe = 31;
optional AppCameraInput cameraInput = 32;
}
I would code a call using a line like:
appRequest.has_getInfo = true;
Amongst others.
Now I moved the proto to v3 it looks like:
protov3:
message AppRequest {
uint32 seq = 1;
uint64 playerId = 2;
int32 playerToken = 3;
oneof action {
AppEmpty getInfo = 8;
AppEmpty getTime = 9;
AppEmpty getMap = 10;
AppEmpty getTeamInfo = 11;
AppEmpty getTeamChat = 12;
AppSendMessage sendTeamMessage = 13;
AppEmpty getEntityInfo = 14;
AppSetEntityValue setEntityValue = 15;
AppEmpty checkSubscription = 16;
AppFlag setSubscription = 17;
AppEmpty getMapMarkers = 18;
AppPromoteToLeader promoteToLeader = 20;
AppEmpty getClanInfo = 21;
AppSendMessage setClanMotd = 22;
AppEmpty getClanChat = 23;
AppSendMessage sendClanMessage = 24;
AppGetNexusAuth getNexusAuth = 25;
AppCameraSubscribe cameraSubscribe = 30;
AppEmpty cameraUnsubscribe = 31;
AppCameraInput cameraInput = 32;
}
}
And I am trying to determine how to code the request type, so it sets it as getInfo.
I note I now have :
which is a union, but I don't know how to code or assign that action to one of the 'oneof' actions.
Can somebody please help!