@@ -7,7 +7,7 @@ use api_helper::{anchor::WatchIndexQuery, ctx::Ctx};
77use futures_util:: { StreamExt , TryStreamExt } ;
88use proto:: backend;
99use rivet_api:: {
10- apis:: { actors_api , configuration:: Configuration } ,
10+ apis:: { actors_v1_api , configuration:: Configuration } ,
1111 models,
1212} ;
1313use rivet_operation:: prelude:: * ;
@@ -29,7 +29,7 @@ pub mod metrics;
2929pub struct GlobalEndpointTypeQuery {
3030 #[ serde( flatten) ]
3131 global : GlobalQuery ,
32- endpoint_type : Option < models:: ActorsEndpointType > ,
32+ endpoint_type : Option < models:: ActorsV1EndpointType > ,
3333}
3434
3535// MARK: GET /actors/{}
@@ -39,7 +39,7 @@ pub async fn get(
3939 actor_id : Uuid ,
4040 watch_index : WatchIndexQuery ,
4141 query : GlobalEndpointTypeQuery ,
42- ) -> GlobalResult < models:: ActorsGetActorResponse > {
42+ ) -> GlobalResult < models:: ActorsV1GetActorResponse > {
4343 get_inner ( & ctx, actor_id, watch_index, query) . await
4444}
4545
@@ -48,7 +48,7 @@ async fn get_inner(
4848 actor_id : Uuid ,
4949 _watch_index : WatchIndexQuery ,
5050 query : GlobalEndpointTypeQuery ,
51- ) -> GlobalResult < models:: ActorsGetActorResponse > {
51+ ) -> GlobalResult < models:: ActorsV1GetActorResponse > {
5252 let CheckOutput { game_id, .. } = ctx
5353 . auth ( )
5454 . check (
@@ -105,8 +105,8 @@ async fn get_inner(
105105 } ;
106106
107107 // Pass the request to the edge api
108- use actors_api :: ActorsGetError :: * ;
109- match actors_api :: actors_get (
108+ use actors_v1_api :: ActorsV1GetError :: * ;
109+ match actors_v1_api :: actors_v1_get (
110110 & config,
111111 & actor_id. to_string ( ) ,
112112 query. global . project . as_deref ( ) ,
@@ -196,9 +196,9 @@ pub async fn get_deprecated(
196196#[ tracing:: instrument( skip_all) ]
197197pub async fn create (
198198 ctx : Ctx < Auth > ,
199- body : models:: ActorsCreateActorRequest ,
199+ body : models:: ActorsV1CreateActorRequest ,
200200 query : GlobalEndpointTypeQuery ,
201- ) -> GlobalResult < models:: ActorsCreateActorResponse > {
201+ ) -> GlobalResult < models:: ActorsV1CreateActorResponse > {
202202 let CheckOutput { game_id, .. } = ctx
203203 . auth ( )
204204 . check (
@@ -227,8 +227,8 @@ pub async fn create(
227227 } ;
228228
229229 // Pass the request to the edge api
230- use actors_api :: ActorsCreateError :: * ;
231- match actors_api :: actors_create (
230+ use actors_v1_api :: ActorsV1CreateError :: * ;
231+ match actors_v1_api :: actors_v1_create (
232232 & config,
233233 body,
234234 query. global . project . as_deref ( ) ,
@@ -272,18 +272,18 @@ pub async fn create_deprecated(
272272 let global = build_global_query_compat ( & ctx, game_id, env_id) . await ?;
273273 let create_res = create (
274274 ctx,
275- models:: ActorsCreateActorRequest {
275+ models:: ActorsV1CreateActorRequest {
276276 region : Some ( dc. name_id . clone ( ) ) ,
277277 lifecycle : body. lifecycle . map ( |l| {
278- Box :: new ( models:: ActorsLifecycle {
278+ Box :: new ( models:: ActorsV1Lifecycle {
279279 kill_timeout : l. kill_timeout ,
280280 durable : Some ( false ) ,
281281 } )
282282 } ) ,
283- network : Some ( Box :: new ( models:: ActorsCreateActorNetworkRequest {
283+ network : Some ( Box :: new ( models:: ActorsV1CreateActorNetworkRequest {
284284 mode : body. network . mode . map ( |n| match n {
285- models:: ServersNetworkMode :: Host => models:: ActorsNetworkMode :: Host ,
286- models:: ServersNetworkMode :: Bridge => models:: ActorsNetworkMode :: Bridge ,
285+ models:: ServersNetworkMode :: Host => models:: ActorsV1NetworkMode :: Host ,
286+ models:: ServersNetworkMode :: Bridge => models:: ActorsV1NetworkMode :: Bridge ,
287287 } ) ,
288288 ports : Some (
289289 body. network
@@ -292,30 +292,30 @@ pub async fn create_deprecated(
292292 . map ( |( k, p) | {
293293 (
294294 k,
295- models:: ActorsCreateActorPortRequest {
295+ models:: ActorsV1CreateActorPortRequest {
296296 internal_port : p. internal_port ,
297297 protocol : match p. protocol {
298298 models:: ServersPortProtocol :: Http => {
299- models:: ActorsPortProtocol :: Http
299+ models:: ActorsV1PortProtocol :: Http
300300 }
301301 models:: ServersPortProtocol :: Https => {
302- models:: ActorsPortProtocol :: Https
302+ models:: ActorsV1PortProtocol :: Https
303303 }
304304 models:: ServersPortProtocol :: Tcp => {
305- models:: ActorsPortProtocol :: Tcp
305+ models:: ActorsV1PortProtocol :: Tcp
306306 }
307307 models:: ServersPortProtocol :: TcpTls => {
308- models:: ActorsPortProtocol :: TcpTls
308+ models:: ActorsV1PortProtocol :: TcpTls
309309 }
310310 models:: ServersPortProtocol :: Udp => {
311- models:: ActorsPortProtocol :: Udp
311+ models:: ActorsV1PortProtocol :: Udp
312312 }
313313 } ,
314314 routing : p. routing . map ( |r| {
315- Box :: new ( models:: ActorsPortRouting {
315+ Box :: new ( models:: ActorsV1PortRouting {
316316 // Temporarily disabled
317317 // guard: r.game_guard.map(|_| {
318- // Box::new(models::ActorsGuardRouting ::default())
318+ // Box::new(models::ActorsV1GuardRouting ::default())
319319 // }),
320320 guard : r. game_guard . map ( |_| json ! ( { } ) ) ,
321321 host : r. host . map ( |_| json ! ( { } ) ) ,
@@ -328,7 +328,7 @@ pub async fn create_deprecated(
328328 ) ,
329329 wait_ready : None ,
330330 } ) ) ,
331- runtime : Some ( Box :: new ( models:: ActorsCreateActorRuntimeRequest {
331+ runtime : Some ( Box :: new ( models:: ActorsV1CreateActorRuntimeRequest {
332332 environment : body. runtime . environment ,
333333 network : None ,
334334 } ) ) ,
@@ -418,8 +418,8 @@ pub async fn destroy(
418418 } ;
419419
420420 // Pass the request to the edge api
421- use actors_api :: ActorsDestroyError :: * ;
422- match actors_api :: actors_destroy (
421+ use actors_v1_api :: ActorsV1DestroyError :: * ;
422+ match actors_v1_api :: actors_v1_destroy (
423423 & config,
424424 & actor_id. to_string ( ) ,
425425 query. global . project . as_deref ( ) ,
@@ -493,7 +493,7 @@ pub async fn destroy_deprecated(
493493pub async fn upgrade (
494494 ctx : Ctx < Auth > ,
495495 actor_id : Uuid ,
496- body : models:: ActorsUpgradeActorRequest ,
496+ body : models:: ActorsV1UpgradeActorRequest ,
497497 query : GlobalQuery ,
498498) -> GlobalResult < serde_json:: Value > {
499499 let CheckOutput { game_id, .. } = ctx
@@ -552,8 +552,8 @@ pub async fn upgrade(
552552 } ;
553553
554554 // Pass the request to the edge api
555- use actors_api :: ActorsUpgradeError :: * ;
556- match actors_api :: actors_upgrade (
555+ use actors_v1_api :: ActorsV1UpgradeError :: * ;
556+ match actors_v1_api :: actors_v1_upgrade (
557557 & config,
558558 & actor_id. to_string ( ) ,
559559 body. clone ( ) ,
@@ -598,9 +598,9 @@ pub async fn upgrade(
598598#[ tracing:: instrument( skip_all) ]
599599pub async fn upgrade_all (
600600 ctx : Ctx < Auth > ,
601- body : models:: ActorsUpgradeAllActorsRequest ,
601+ body : models:: ActorsV1UpgradeAllActorsRequest ,
602602 query : GlobalQuery ,
603- ) -> GlobalResult < models:: ActorsUpgradeAllActorsResponse > {
603+ ) -> GlobalResult < models:: ActorsV1UpgradeAllActorsResponse > {
604604 let CheckOutput { game_id, .. } = ctx
605605 . auth ( )
606606 . check (
@@ -697,8 +697,8 @@ pub async fn upgrade_all(
697697 } ;
698698
699699 // Pass the request to the edge api
700- use actors_api :: ActorsUpgradeAllError :: * ;
701- match actors_api :: actors_upgrade_all (
700+ use actors_v1_api :: ActorsV1UpgradeAllError :: * ;
701+ match actors_v1_api :: actors_v1_upgrade_all (
702702 & config,
703703 body. clone ( ) ,
704704 query. project . as_deref ( ) ,
@@ -731,7 +731,7 @@ pub async fn upgrade_all(
731731 . try_fold ( 0 , |a, res| std:: future:: ready ( Ok ( a + res. count ) ) )
732732 . await ?;
733733
734- Ok ( models:: ActorsUpgradeAllActorsResponse { count } )
734+ Ok ( models:: ActorsV1UpgradeAllActorsResponse { count } )
735735}
736736
737737// MARK: GET /actors
@@ -749,15 +749,15 @@ pub async fn list_actors(
749749 ctx : Ctx < Auth > ,
750750 watch_index : WatchIndexQuery ,
751751 query : ListQuery ,
752- ) -> GlobalResult < models:: ActorsListActorsResponse > {
752+ ) -> GlobalResult < models:: ActorsV1ListActorsResponse > {
753753 list_actors_inner ( & ctx, watch_index, query) . await
754754}
755755
756756async fn list_actors_inner (
757757 ctx : & Ctx < Auth > ,
758758 _watch_index : WatchIndexQuery ,
759759 query : ListQuery ,
760- ) -> GlobalResult < models:: ActorsListActorsResponse > {
760+ ) -> GlobalResult < models:: ActorsV1ListActorsResponse > {
761761 let CheckOutput { game_id, .. } = ctx
762762 . auth ( )
763763 . check (
@@ -863,7 +863,7 @@ async fn list_actors_inner(
863863 // Pass the request to the edge api
864864 let timeout_res = tokio:: time:: timeout (
865865 Duration :: from_secs ( 30 ) ,
866- actors_api :: actors_list (
866+ actors_v1_api :: actors_v1_list (
867867 & config,
868868 query. global_endpoint_type . global . project . as_deref ( ) ,
869869 query. global_endpoint_type . global . environment . as_deref ( ) ,
@@ -876,7 +876,7 @@ async fn list_actors_inner(
876876 )
877877 . await ;
878878
879- use actors_api :: ActorsListError :: * ;
879+ use actors_v1_api :: ActorsV1ListError :: * ;
880880 match timeout_res {
881881 Ok ( timeout_res) => match timeout_res {
882882 Ok ( res) => Ok ( res) ,
@@ -943,7 +943,7 @@ async fn list_actors_inner(
943943 unix_ts. to_string ( )
944944 } ) ;
945945
946- Ok ( models:: ActorsListActorsResponse {
946+ Ok ( models:: ActorsV1ListActorsResponse {
947947 actors,
948948 pagination : Box :: new ( models:: Pagination { cursor } ) ,
949949 } )
@@ -1014,7 +1014,7 @@ pub async fn list_servers_deprecated(
10141014}
10151015
10161016fn legacy_convert_actor_to_server (
1017- a : models:: ActorsActor ,
1017+ a : models:: ActorsV1Actor ,
10181018 datacenter : & cluster:: types:: Datacenter ,
10191019) -> GlobalResult < models:: ServersServer > {
10201020 Ok ( models:: ServersServer {
@@ -1039,8 +1039,8 @@ fn legacy_convert_actor_to_server(
10391039 } ) ,
10401040 network : Box :: new ( models:: ServersNetwork {
10411041 mode : Some ( match a. network . mode {
1042- models:: ActorsNetworkMode :: Host => models:: ServersNetworkMode :: Host ,
1043- models:: ActorsNetworkMode :: Bridge => models:: ServersNetworkMode :: Bridge ,
1042+ models:: ActorsV1NetworkMode :: Host => models:: ServersNetworkMode :: Host ,
1043+ models:: ActorsV1NetworkMode :: Bridge => models:: ServersNetworkMode :: Bridge ,
10441044 } ) ,
10451045 ports : a
10461046 . network
@@ -1052,17 +1052,21 @@ fn legacy_convert_actor_to_server(
10521052 models:: ServersPort {
10531053 internal_port : p. internal_port ,
10541054 protocol : match p. protocol {
1055- models:: ActorsPortProtocol :: Http => {
1055+ models:: ActorsV1PortProtocol :: Http => {
10561056 models:: ServersPortProtocol :: Http
10571057 }
1058- models:: ActorsPortProtocol :: Https => {
1058+ models:: ActorsV1PortProtocol :: Https => {
10591059 models:: ServersPortProtocol :: Https
10601060 }
1061- models:: ActorsPortProtocol :: Tcp => models:: ServersPortProtocol :: Tcp ,
1062- models:: ActorsPortProtocol :: TcpTls => {
1061+ models:: ActorsV1PortProtocol :: Tcp => {
1062+ models:: ServersPortProtocol :: Tcp
1063+ }
1064+ models:: ActorsV1PortProtocol :: TcpTls => {
10631065 models:: ServersPortProtocol :: TcpTls
10641066 }
1065- models:: ActorsPortProtocol :: Udp => models:: ServersPortProtocol :: Udp ,
1067+ models:: ActorsV1PortProtocol :: Udp => {
1068+ models:: ServersPortProtocol :: Udp
1069+ }
10661070 } ,
10671071 public_hostname : p. hostname ,
10681072 public_port : p. port ,
0 commit comments