diff --git a/Aurora/Proto/party.v2.proto b/Aurora/Proto/party.v2.proto index bc3856e..1c84f06 100644 --- a/Aurora/Proto/party.v2.proto +++ b/Aurora/Proto/party.v2.proto @@ -5,30 +5,220 @@ package Aurora.Proto.Party; import "Proto/general.proto"; service RemotePartyService { + //************** //Party Resource - //Get Party - //CUSTOM: Join - //CUSTOM: Leave + //************** + //Get Party + rpc GetParty(Aurora.Proto.General.Empty) returns (Party); + //CUSTOM: Join + rpc JoinParty(JoinPartyRequest) returns (JoinPartyResponse); + + //CUSTOM: Leave + rpc LeaveParty(LeavePartyRequest) returns (LeavePartyResponse); + + //*************** //Member Resource - //List - //Get - //Create - //Update - //Delete + //*************** + //List + rpc ListMembers(ListMembersRequest) returns (ListMembersResponse); + + //Get + rpc GetMember(GetMemberRequest) returns (Member); + //************** //Media Resource - //List - //Get - //CUSTOM: Stream - //CUSTOM: Sync + //************** + //List + rpc ListMedia(ListMediaRequest) returns (ListMediaResposne); + //Get + rpc GetMedia(GetMediaRequest) returns (RemoteMedia); + + //CUSTOM: Stream + rpc StreamMedia(StreamMediaRequest) returns (stream Aurora.Proto.General.Chunk) {}; + + //CUSTOM: Sync + rpc SyncMedia(SyncMediaRequest) returns (stream Sync) {}; + + //*************************** //EventSubscriptions Resource - //List - //Get - //Create - //Delete + //*************************** + //List + rpc ListEventSubscriptions(ListEventSubscriptionsRequest) returns (ListEventSubscriptionsResponse); + + //Create + rpc CreateEventSubscription(CreateEventSubscriptionRequest) returns (EventSubscription); + //Delete + rpc DeleteEventSubscription(DeleteEventSubscriptionRequest) returns (Aurora.Proto.General.Empty); + + //CUSTOM: Delete all + rpc DeleteAllEventSubsciptions(DeleteAllEventSubscriptions) returns (Aurora.Proto.General.Empty); + + //***** //Event - //Get + //***** + //Get + rpc GetEvents(GetEventsRequest) returns (stream BaseEvent) {}; +} + +message Party { + string name = 1; + string displayName = 2; + string description = 3; + string host = 4; + Timestamp createdTime = 5; +} + +message JoinPartyRequest { + string userName = 2; +} + +enum PartyJoinedStatusEnum { + InParty = 0; + NotInParty = 1; +} + +message JoinPartyResponse { + PartyJoinedStatusEnum status = 1; + string clientId = 2; +} + +message LeavePartyRequest { + string clientId = 1; +} + +message LeavePartyResponse { + PartyJoinedStatusEnum status = 1; +} + +message PartyMember { + string name = 1; + string userName = 2; + string id = 3; + string ipAddress = 4; + int32 port = 5; +} + +message ListMembersRequest { + string parent = 1; + int32 pageSize = 2; + string pageToken = 3; +} + +message ListMembersResponse { + repeated PartyMember members = 1; + string nextPageToken = 2; +} + +message GetMemberRequest { + string name = 1; +} + +message RemoteMedia { + string id = 1; + string title = 2; + string artist = 3; + string album = 4; + string duration = 5; +} + +message ListMediaRequest { + string parent = 1; + int32 pageSize = 2; + string pageToken = 3; +} + +message ListMediaResponse { + repeated RemoteMedia media = 1; + string nextPageToken = 3; +} + +message GetMediaRequest { + string name = 1; +} + +message StreamMediaRequest { + string name = 1; +} + +message Sync { + int64 serverTimeTicks = 1; + float trackPosition= 2; +} + +/* Event Types */ +enum EventType { + PartyMemberJoined = 0; + PartyMemberLeft = 1; + MediaPlaying = 2; + MediaStopped = 3; +} + +message BaseEvent { + string name = 1; + EventType eventType = 2; + string clientKey = 3; + + oneof derivedEvent { + PartyMemberJoinedEvent partyMemberJoinedEvent = 4; + PartyMemberLeftEvent partyMemberLeftEvent = 5; + NewMediaPlayingEvent newMediaPlayingEvent = 6; + MediaPausedEvent mediaPausedEvent = 7; + MediaResumedEvent mediaResumedEvent = 8; + } +} + +message NewMediaPlayingEvent { + Aurora.Proto.Party.RemoteMediaData media = 1; +} + +message MediaResumedEvent { + Aurora.Proto.General.Empty empty = 1; +} + +message MediaPausedEvent { + Aurora.Proto.General.Empty empty = 1; +} + +message PartyMemberJoinedEvent { + Aurora.Proto.Party.PartyMember member = 1; +} + +message PartyMemberLeftEvent { + Aurora.Proto.Party.PartyMember member = 1; +} + +message EventSubscription { + string name = 1; + EventType type = 2; +} + +message ListEventSubscriptionsRequest { + string parent = 1; + int32 pageSize = 2; + string pageToken = 3; +} + +message ListEventSubscriptionsResponse { + repeated EventSubscription subscriptions = 1; + string nextPageToken = 3; +} + +message CreateEventSubscriptionRequest { + string parent = 1; + EventSubscription eventSubscription = 2; +} + +message DeleteEventSubscriptionRequest { + string name = 1; +} + +message DeleteAllEventSubscriptionsRequest { + string parent = 1; +} + +message GetEventsRequest { + string parent = 1; }