-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathosrdEditoastApi.ts
1925 lines (1924 loc) · 57 KB
/
osrdEditoastApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { baseEditoastApi as api } from './emptyApi';
export const addTagTypes = [
'layers',
'infra',
'routes',
'pathfinding',
'electrical_profiles',
'documents',
'rolling_stock',
'rolling_stock_livery',
'projects',
'timetable',
'studies',
'scenarios',
'train_schedule',
] as const;
const injectedRtkApi = api
.enhanceEndpoints({
addTagTypes,
})
.injectEndpoints({
endpoints: (build) => ({
getHealth: build.query<GetHealthApiResponse, GetHealthApiArg>({
query: () => ({ url: `/health/` }),
}),
getVersion: build.query<GetVersionApiResponse, GetVersionApiArg>({
query: () => ({ url: `/version/` }),
}),
postSearch: build.mutation<PostSearchApiResponse, PostSearchApiArg>({
query: (queryArg) => ({ url: `/search/`, method: 'POST', body: queryArg.body }),
}),
getLayersLayerByLayerSlugMvtAndViewSlug: build.query<
GetLayersLayerByLayerSlugMvtAndViewSlugApiResponse,
GetLayersLayerByLayerSlugMvtAndViewSlugApiArg
>({
query: (queryArg) => ({
url: `/layers/layer/${queryArg.layerSlug}/mvt/${queryArg.viewSlug}/`,
params: { infra: queryArg.infra },
}),
providesTags: ['layers'],
}),
getLayersTileByLayerSlugAndViewSlugZXY: build.query<
GetLayersTileByLayerSlugAndViewSlugZXYApiResponse,
GetLayersTileByLayerSlugAndViewSlugZXYApiArg
>({
query: (queryArg) => ({
url: `/layers/tile/${queryArg.layerSlug}/${queryArg.viewSlug}/${queryArg.z}/${queryArg.x}/${queryArg.y}/`,
params: { infra: queryArg.infra },
}),
providesTags: ['layers'],
}),
getInfra: build.query<GetInfraApiResponse, GetInfraApiArg>({
query: () => ({ url: `/infra/` }),
providesTags: ['infra'],
}),
postInfra: build.mutation<PostInfraApiResponse, PostInfraApiArg>({
query: (queryArg) => ({ url: `/infra/`, method: 'POST', body: queryArg.body }),
invalidatesTags: ['infra'],
}),
getInfraById: build.query<GetInfraByIdApiResponse, GetInfraByIdApiArg>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/` }),
providesTags: ['infra'],
}),
deleteInfraById: build.mutation<DeleteInfraByIdApiResponse, DeleteInfraByIdApiArg>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/`, method: 'DELETE' }),
invalidatesTags: ['infra'],
}),
postInfraById: build.mutation<PostInfraByIdApiResponse, PostInfraByIdApiArg>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/`,
method: 'POST',
body: queryArg.body,
}),
invalidatesTags: ['infra'],
}),
putInfraById: build.mutation<PutInfraByIdApiResponse, PutInfraByIdApiArg>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/`,
method: 'PUT',
body: queryArg.body,
}),
invalidatesTags: ['infra'],
}),
postInfraByIdLoad: build.mutation<PostInfraByIdLoadApiResponse, PostInfraByIdLoadApiArg>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/load/`, method: 'POST' }),
invalidatesTags: ['infra'],
}),
getInfraByIdRailjson: build.query<
GetInfraByIdRailjsonApiResponse,
GetInfraByIdRailjsonApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/railjson/` }),
providesTags: ['infra'],
}),
postInfraRailjson: build.mutation<PostInfraRailjsonApiResponse, PostInfraRailjsonApiArg>({
query: (queryArg) => ({
url: `/infra/railjson/`,
method: 'POST',
body: queryArg.railjsonFile,
params: { name: queryArg.name, generate_data: queryArg.generateData },
}),
invalidatesTags: ['infra'],
}),
getInfraByIdErrors: build.query<GetInfraByIdErrorsApiResponse, GetInfraByIdErrorsApiArg>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/errors/`,
params: {
page: queryArg.page,
page_size: queryArg.pageSize,
error_type: queryArg.errorType,
object_id: queryArg.objectId,
level: queryArg.level,
},
}),
providesTags: ['infra'],
}),
getInfraByIdSwitchTypes: build.query<
GetInfraByIdSwitchTypesApiResponse,
GetInfraByIdSwitchTypesApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/switch_types/` }),
providesTags: ['infra'],
}),
postInfraRefresh: build.mutation<PostInfraRefreshApiResponse, PostInfraRefreshApiArg>({
query: (queryArg) => ({
url: `/infra/refresh/`,
method: 'POST',
params: { infras: queryArg.infras, force: queryArg.force },
}),
invalidatesTags: ['infra'],
}),
getInfraByIdLinesAndLineCodeBbox: build.query<
GetInfraByIdLinesAndLineCodeBboxApiResponse,
GetInfraByIdLinesAndLineCodeBboxApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/lines/${queryArg.lineCode}/bbox/` }),
providesTags: ['infra'],
}),
postInfraByIdLock: build.mutation<PostInfraByIdLockApiResponse, PostInfraByIdLockApiArg>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/lock/`, method: 'POST' }),
invalidatesTags: ['infra'],
}),
postInfraByIdUnlock: build.mutation<
PostInfraByIdUnlockApiResponse,
PostInfraByIdUnlockApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/unlock/`, method: 'POST' }),
invalidatesTags: ['infra'],
}),
getInfraByIdSpeedLimitTags: build.query<
GetInfraByIdSpeedLimitTagsApiResponse,
GetInfraByIdSpeedLimitTagsApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/speed_limit_tags/` }),
providesTags: ['infra'],
}),
getInfraByIdVoltages: build.query<
GetInfraByIdVoltagesApiResponse,
GetInfraByIdVoltagesApiArg
>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/voltages/`,
params: { include_rolling_stock_modes: queryArg.includeRollingStockModes },
}),
providesTags: ['infra'],
}),
getInfraByIdAttachedAndTrackId: build.query<
GetInfraByIdAttachedAndTrackIdApiResponse,
GetInfraByIdAttachedAndTrackIdApiArg
>({
query: (queryArg) => ({ url: `/infra/${queryArg.id}/attached/${queryArg.trackId}/` }),
providesTags: ['infra'],
}),
getInfraByIdRoutesAndWaypointTypeWaypointId: build.query<
GetInfraByIdRoutesAndWaypointTypeWaypointIdApiResponse,
GetInfraByIdRoutesAndWaypointTypeWaypointIdApiArg
>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/routes/${queryArg.waypointType}/${queryArg.waypointId}/`,
}),
providesTags: ['infra', 'routes'],
}),
getInfraByIdRoutesTrackRanges: build.query<
GetInfraByIdRoutesTrackRangesApiResponse,
GetInfraByIdRoutesTrackRangesApiArg
>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/routes/track_ranges/`,
params: { routes: queryArg.routes },
}),
providesTags: ['infra', 'routes'],
}),
postInfraByIdPathfinding: build.mutation<
PostInfraByIdPathfindingApiResponse,
PostInfraByIdPathfindingApiArg
>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/pathfinding/`,
method: 'POST',
body: queryArg.body,
params: { number: queryArg.number },
}),
invalidatesTags: ['infra', 'pathfinding'],
}),
postInfraByIdObjectsAndObjectType: build.mutation<
PostInfraByIdObjectsAndObjectTypeApiResponse,
PostInfraByIdObjectsAndObjectTypeApiArg
>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/objects/${queryArg.objectType}/`,
method: 'POST',
body: queryArg.body,
}),
invalidatesTags: ['infra'],
}),
postInfraByIdClone: build.mutation<PostInfraByIdCloneApiResponse, PostInfraByIdCloneApiArg>({
query: (queryArg) => ({
url: `/infra/${queryArg.id}/clone/`,
method: 'POST',
params: { name: queryArg.name },
}),
invalidatesTags: ['infra'],
}),
getElectricalProfileSet: build.query<
GetElectricalProfileSetApiResponse,
GetElectricalProfileSetApiArg
>({
query: () => ({ url: `/electrical_profile_set/` }),
providesTags: ['electrical_profiles'],
}),
postElectricalProfileSet: build.mutation<
PostElectricalProfileSetApiResponse,
PostElectricalProfileSetApiArg
>({
query: (queryArg) => ({
url: `/electrical_profile_set/`,
method: 'POST',
params: { name: queryArg.name },
}),
invalidatesTags: ['electrical_profiles'],
}),
getElectricalProfileSetById: build.query<
GetElectricalProfileSetByIdApiResponse,
GetElectricalProfileSetByIdApiArg
>({
query: (queryArg) => ({ url: `/electrical_profile_set/${queryArg.id}/` }),
providesTags: ['electrical_profiles'],
}),
getElectricalProfileSetByIdLevelOrder: build.query<
GetElectricalProfileSetByIdLevelOrderApiResponse,
GetElectricalProfileSetByIdLevelOrderApiArg
>({
query: (queryArg) => ({ url: `/electrical_profile_set/${queryArg.id}/level_order/` }),
providesTags: ['electrical_profiles'],
}),
getDocumentsByKey: build.query<GetDocumentsByKeyApiResponse, GetDocumentsByKeyApiArg>({
query: (queryArg) => ({ url: `/documents/${queryArg.key}/` }),
providesTags: ['documents'],
}),
deleteDocumentsByKey: build.mutation<
DeleteDocumentsByKeyApiResponse,
DeleteDocumentsByKeyApiArg
>({
query: (queryArg) => ({ url: `/documents/${queryArg.key}/`, method: 'DELETE' }),
invalidatesTags: ['documents'],
}),
postDocuments: build.mutation<PostDocumentsApiResponse, PostDocumentsApiArg>({
query: () => ({ url: `/documents/`, method: 'POST' }),
invalidatesTags: ['documents'],
}),
getLightRollingStock: build.query<
GetLightRollingStockApiResponse,
GetLightRollingStockApiArg
>({
query: (queryArg) => ({
url: `/light_rolling_stock/`,
params: { page: queryArg.page, page_size: queryArg.pageSize },
}),
providesTags: ['rolling_stock'],
}),
getLightRollingStockById: build.query<
GetLightRollingStockByIdApiResponse,
GetLightRollingStockByIdApiArg
>({
query: (queryArg) => ({ url: `/light_rolling_stock/${queryArg.id}/` }),
providesTags: ['rolling_stock'],
}),
postPathfinding: build.mutation<PostPathfindingApiResponse, PostPathfindingApiArg>({
query: (queryArg) => ({ url: `/pathfinding/`, method: 'POST', body: queryArg.pathQuery }),
}),
getPathfindingById: build.query<GetPathfindingByIdApiResponse, GetPathfindingByIdApiArg>({
query: (queryArg) => ({ url: `/pathfinding/${queryArg.id}/` }),
providesTags: ['pathfinding'],
}),
putPathfindingById: build.mutation<PutPathfindingByIdApiResponse, PutPathfindingByIdApiArg>({
query: (queryArg) => ({
url: `/pathfinding/${queryArg.id}/`,
method: 'PUT',
body: queryArg.pathQuery,
}),
invalidatesTags: ['pathfinding'],
}),
deletePathfindingById: build.mutation<
DeletePathfindingByIdApiResponse,
DeletePathfindingByIdApiArg
>({
query: (queryArg) => ({ url: `/pathfinding/${queryArg.id}/`, method: 'DELETE' }),
invalidatesTags: ['pathfinding'],
}),
postRollingStock: build.mutation<PostRollingStockApiResponse, PostRollingStockApiArg>({
query: (queryArg) => ({
url: `/rolling_stock/`,
method: 'POST',
body: queryArg.rollingStockUpsertPayload,
params: { locked: queryArg.locked },
}),
invalidatesTags: ['rolling_stock'],
}),
getRollingStockById: build.query<GetRollingStockByIdApiResponse, GetRollingStockByIdApiArg>({
query: (queryArg) => ({ url: `/rolling_stock/${queryArg.id}/` }),
providesTags: ['rolling_stock'],
}),
patchRollingStockById: build.mutation<
PatchRollingStockByIdApiResponse,
PatchRollingStockByIdApiArg
>({
query: (queryArg) => ({
url: `/rolling_stock/${queryArg.id}/`,
method: 'PATCH',
body: queryArg.rollingStockUpsertPayload,
}),
invalidatesTags: ['rolling_stock'],
}),
deleteRollingStockById: build.mutation<
DeleteRollingStockByIdApiResponse,
DeleteRollingStockByIdApiArg
>({
query: (queryArg) => ({
url: `/rolling_stock/${queryArg.id}/`,
method: 'DELETE',
params: { force: queryArg.force },
}),
invalidatesTags: ['rolling_stock'],
}),
patchRollingStockByIdLocked: build.mutation<
PatchRollingStockByIdLockedApiResponse,
PatchRollingStockByIdLockedApiArg
>({
query: (queryArg) => ({
url: `/rolling_stock/${queryArg.id}/locked/`,
method: 'PATCH',
body: queryArg.body,
}),
invalidatesTags: ['rolling_stock'],
}),
postRollingStockByIdLivery: build.mutation<
PostRollingStockByIdLiveryApiResponse,
PostRollingStockByIdLiveryApiArg
>({
query: (queryArg) => ({
url: `/rolling_stock/${queryArg.id}/livery/`,
method: 'POST',
body: queryArg.body,
}),
invalidatesTags: ['rolling_stock', 'rolling_stock_livery'],
}),
postProjects: build.mutation<PostProjectsApiResponse, PostProjectsApiArg>({
query: (queryArg) => ({
url: `/projects/`,
method: 'POST',
body: queryArg.projectCreateRequest,
}),
invalidatesTags: ['projects'],
}),
getProjects: build.query<GetProjectsApiResponse, GetProjectsApiArg>({
query: (queryArg) => ({
url: `/projects/`,
params: {
ordering: queryArg.ordering,
name: queryArg.name,
description: queryArg.description,
tags: queryArg.tags,
page: queryArg.page,
page_size: queryArg.pageSize,
},
}),
providesTags: ['projects'],
}),
getProjectsByProjectId: build.query<
GetProjectsByProjectIdApiResponse,
GetProjectsByProjectIdApiArg
>({
query: (queryArg) => ({ url: `/projects/${queryArg.projectId}/` }),
providesTags: ['projects'],
}),
patchProjectsByProjectId: build.mutation<
PatchProjectsByProjectIdApiResponse,
PatchProjectsByProjectIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/`,
method: 'PATCH',
body: queryArg.projectPatchRequest,
}),
invalidatesTags: ['projects'],
}),
deleteProjectsByProjectId: build.mutation<
DeleteProjectsByProjectIdApiResponse,
DeleteProjectsByProjectIdApiArg
>({
query: (queryArg) => ({ url: `/projects/${queryArg.projectId}/`, method: 'DELETE' }),
invalidatesTags: ['projects'],
}),
getTimetableById: build.query<GetTimetableByIdApiResponse, GetTimetableByIdApiArg>({
query: (queryArg) => ({ url: `/timetable/${queryArg.id}/` }),
providesTags: ['timetable'],
}),
getTimetableByIdConflicts: build.query<
GetTimetableByIdConflictsApiResponse,
GetTimetableByIdConflictsApiArg
>({
query: (queryArg) => ({ url: `/timetable/${queryArg.id}/conflicts/` }),
providesTags: ['timetable'],
}),
postProjectsByProjectIdStudies: build.mutation<
PostProjectsByProjectIdStudiesApiResponse,
PostProjectsByProjectIdStudiesApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/`,
method: 'POST',
body: queryArg.studyUpsertRequest,
}),
invalidatesTags: ['studies'],
}),
getProjectsByProjectIdStudies: build.query<
GetProjectsByProjectIdStudiesApiResponse,
GetProjectsByProjectIdStudiesApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/`,
params: {
ordering: queryArg.ordering,
name: queryArg.name,
description: queryArg.description,
tags: queryArg.tags,
page: queryArg.page,
page_size: queryArg.pageSize,
},
}),
providesTags: ['studies'],
}),
getProjectsByProjectIdStudiesAndStudyId: build.query<
GetProjectsByProjectIdStudiesAndStudyIdApiResponse,
GetProjectsByProjectIdStudiesAndStudyIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/`,
}),
providesTags: ['studies'],
}),
patchProjectsByProjectIdStudiesAndStudyId: build.mutation<
PatchProjectsByProjectIdStudiesAndStudyIdApiResponse,
PatchProjectsByProjectIdStudiesAndStudyIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/`,
method: 'PATCH',
body: queryArg.studyUpsertRequest,
}),
invalidatesTags: ['studies'],
}),
deleteProjectsByProjectIdStudiesAndStudyId: build.mutation<
DeleteProjectsByProjectIdStudiesAndStudyIdApiResponse,
DeleteProjectsByProjectIdStudiesAndStudyIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/`,
method: 'DELETE',
}),
invalidatesTags: ['studies'],
}),
postProjectsByProjectIdStudiesAndStudyIdScenarios: build.mutation<
PostProjectsByProjectIdStudiesAndStudyIdScenariosApiResponse,
PostProjectsByProjectIdStudiesAndStudyIdScenariosApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/`,
method: 'POST',
body: queryArg.scenarioRequest,
}),
invalidatesTags: ['scenarios'],
}),
getProjectsByProjectIdStudiesAndStudyIdScenarios: build.query<
GetProjectsByProjectIdStudiesAndStudyIdScenariosApiResponse,
GetProjectsByProjectIdStudiesAndStudyIdScenariosApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/`,
params: {
ordering: queryArg.ordering,
page: queryArg.page,
page_size: queryArg.pageSize,
},
}),
providesTags: ['scenarios'],
}),
getProjectsByProjectIdStudiesAndStudyIdScenariosScenarioId: build.query<
GetProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiResponse,
GetProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/`,
}),
providesTags: ['scenarios'],
}),
deleteProjectsByProjectIdStudiesAndStudyIdScenariosScenarioId: build.mutation<
DeleteProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiResponse,
DeleteProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/`,
method: 'DELETE',
}),
invalidatesTags: ['scenarios'],
}),
patchProjectsByProjectIdStudiesAndStudyIdScenariosScenarioId: build.mutation<
PatchProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiResponse,
PatchProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdApiArg
>({
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/`,
method: 'PATCH',
body: queryArg.scenarioPatchRequest,
}),
invalidatesTags: ['scenarios'],
}),
getPathfindingByPathIdCatenaries: build.query<
GetPathfindingByPathIdCatenariesApiResponse,
GetPathfindingByPathIdCatenariesApiArg
>({
query: (queryArg) => ({ url: `/pathfinding/${queryArg.pathId}/catenaries/` }),
providesTags: ['infra'],
}),
getTrainScheduleById: build.query<
GetTrainScheduleByIdApiResponse,
GetTrainScheduleByIdApiArg
>({
query: (queryArg) => ({ url: `/train_schedule/${queryArg.id}/` }),
providesTags: ['train_schedule'],
}),
deleteTrainScheduleById: build.mutation<
DeleteTrainScheduleByIdApiResponse,
DeleteTrainScheduleByIdApiArg
>({
query: (queryArg) => ({ url: `/train_schedule/${queryArg.id}/`, method: 'DELETE' }),
invalidatesTags: ['train_schedule'],
}),
patchTrainScheduleById: build.mutation<
PatchTrainScheduleByIdApiResponse,
PatchTrainScheduleByIdApiArg
>({
query: (queryArg) => ({
url: `/train_schedule/${queryArg.id}/`,
method: 'PATCH',
body: queryArg.body,
}),
invalidatesTags: ['train_schedule'],
}),
getTrainScheduleByIdResult: build.query<
GetTrainScheduleByIdResultApiResponse,
GetTrainScheduleByIdResultApiArg
>({
query: (queryArg) => ({
url: `/train_schedule/${queryArg.id}/result/`,
params: { path_id: queryArg.pathId },
}),
providesTags: ['train_schedule'],
}),
getTrainScheduleResults: build.query<
GetTrainScheduleResultsApiResponse,
GetTrainScheduleResultsApiArg
>({
query: (queryArg) => ({
url: `/train_schedule/results/`,
params: { path_id: queryArg.pathId, train_ids: queryArg.trainIds },
}),
providesTags: ['train_schedule'],
}),
postTrainScheduleStandaloneSimulation: build.mutation<
PostTrainScheduleStandaloneSimulationApiResponse,
PostTrainScheduleStandaloneSimulationApiArg
>({
query: (queryArg) => ({
url: `/train_schedule/standalone_simulation/`,
method: 'POST',
body: queryArg.body,
}),
invalidatesTags: ['train_schedule'],
}),
}),
overrideExisting: false,
});
export { injectedRtkApi as osrdEditoastApi };
export type GetHealthApiResponse = unknown;
export type GetHealthApiArg = void;
export type GetVersionApiResponse = /** status 200 Return the service version */ {
git_describe: string | null;
};
export type GetVersionApiArg = void;
export type PostSearchApiResponse =
/** status 200 Search results, the structure of the returned objects depend on their type */ (
| SearchTrackResult
| SearchOperationalPointResult
| SearchSignalResult
| SearchStudyResult
| SearchProjectResult
| SearchScenarioResult
)[];
export type PostSearchApiArg = {
/** Search query */
body: {
object?: string;
query?: SearchQuery;
page?: number;
page_size?: number;
};
};
export type GetLayersLayerByLayerSlugMvtAndViewSlugApiResponse =
/** status 200 Successful Response */ ViewMetadata;
export type GetLayersLayerByLayerSlugMvtAndViewSlugApiArg = {
layerSlug: string;
viewSlug: string;
infra: number;
};
export type GetLayersTileByLayerSlugAndViewSlugZXYApiResponse = unknown;
export type GetLayersTileByLayerSlugAndViewSlugZXYApiArg = {
layerSlug: string;
viewSlug: string;
z: number;
x: number;
y: number;
infra: number;
};
export type GetInfraApiResponse = /** status 200 The infra list */ {
count: number;
next: any;
previous: any;
results?: Infra[];
};
export type GetInfraApiArg = void;
export type PostInfraApiResponse = /** status 201 The created infra */ Infra;
export type PostInfraApiArg = {
/** Name of the infra to create */
body: {
name?: string;
};
};
export type GetInfraByIdApiResponse = /** status 200 Information about the retrieved infra */ Infra;
export type GetInfraByIdApiArg = {
/** infra id */
id: number;
};
export type DeleteInfraByIdApiResponse = unknown;
export type DeleteInfraByIdApiArg = {
/** infra id */
id: number;
};
export type PostInfraByIdApiResponse =
/** status 200 An array containing infos about the operations processed */ OperationResult[];
export type PostInfraByIdApiArg = {
/** infra id */
id: number;
/** Operations to do on the infra */
body: Operation[];
};
export type PutInfraByIdApiResponse = /** status 200 The updated infra */ Infra;
export type PutInfraByIdApiArg = {
/** infra id */
id: number;
/** the name we want to give to the infra */
body: {
name?: string;
};
};
export type PostInfraByIdLoadApiResponse = unknown;
export type PostInfraByIdLoadApiArg = {
/** infra id */
id: number;
};
export type GetInfraByIdRailjsonApiResponse =
/** status 200 The infra in railjson format */ RailjsonFile;
export type GetInfraByIdRailjsonApiArg = {
/** Infra ID */
id: number;
};
export type PostInfraRailjsonApiResponse = /** status 201 The imported infra id */ {
id?: string;
};
export type PostInfraRailjsonApiArg = {
/** Infra name */
name: string;
generateData?: boolean;
/** Railjson infra */
railjsonFile: RailjsonFile;
};
export type GetInfraByIdErrorsApiResponse = /** status 200 A paginated list of errors */ {
count?: number;
next?: number | null;
previous?: number | null;
results?: InfraError[];
};
export type GetInfraByIdErrorsApiArg = {
/** infra id */
id: number;
/** The page number */
page?: number;
/** The number of item per page */
pageSize?: number;
/** The type of error to filter on */
errorType?: InfraErrorType;
/** errors and warnings that only part of a given object */
objectId?: string;
/** Whether the response should include errors or warnings */
level?: 'errors' | 'warnings' | 'all';
};
export type GetInfraByIdSwitchTypesApiResponse = /** status 200 A list of switch types */ object[];
export type GetInfraByIdSwitchTypesApiArg = {
/** infra id */
id: number;
};
export type PostInfraRefreshApiResponse =
/** status 200 A list thats contains the ID of the infras that were refreshed* */ number[];
export type PostInfraRefreshApiArg = {
/** A list of infra ID */
infras?: number[];
/** Force the refresh of the layers */
force?: boolean;
};
export type GetInfraByIdLinesAndLineCodeBboxApiResponse =
/** status 200 The BBox of the line */ Zone;
export type GetInfraByIdLinesAndLineCodeBboxApiArg = {
/** infra id */
id: number;
/** a line code */
lineCode: number;
};
export type PostInfraByIdLockApiResponse = unknown;
export type PostInfraByIdLockApiArg = {
/** infra id */
id: number;
};
export type PostInfraByIdUnlockApiResponse = unknown;
export type PostInfraByIdUnlockApiArg = {
/** infra id */
id: number;
};
export type GetInfraByIdSpeedLimitTagsApiResponse = /** status 200 Tags list */ string[];
export type GetInfraByIdSpeedLimitTagsApiArg = {
/** Infra id */
id: number;
};
export type GetInfraByIdVoltagesApiResponse = /** status 200 Voltages list */ string[];
export type GetInfraByIdVoltagesApiArg = {
/** Infra ID */
id: number;
/** include rolling stocks modes or not */
includeRollingStockModes?: boolean;
};
export type GetInfraByIdAttachedAndTrackIdApiResponse =
/** status 200 All objects attached to the given track (arranged by types) */ {
[key: string]: string[];
};
export type GetInfraByIdAttachedAndTrackIdApiArg = {
/** Infra ID */
id: number;
/** Track ID */
trackId: string;
};
export type GetInfraByIdRoutesAndWaypointTypeWaypointIdApiResponse =
/** status 200 All routes that starting and ending by the given waypoint */ {
starting?: string[];
ending?: string[];
};
export type GetInfraByIdRoutesAndWaypointTypeWaypointIdApiArg = {
/** Infra ID */
id: number;
/** Type of the waypoint */
waypointType: 'Detector' | 'BufferStop';
/** The waypoint id */
waypointId: string;
};
export type GetInfraByIdRoutesTrackRangesApiResponse =
/** status 200 Foreach route, the track ranges through which it passes or an error */ (
| RouteTrackRangesNotFoundError
| RouteTrackRangesCantComputePathError
| RouteTrackRangesComputed
)[];
export type GetInfraByIdRoutesTrackRangesApiArg = {
/** Infra ID */
id: number;
routes: string;
};
export type PostInfraByIdPathfindingApiResponse =
/** status 200 Paths, containing track ranges, detectors and switches with their directions. If no path is found, an empty list is returned. */ {
track_ranges?: DirectionalTrackRange[];
detectors?: string[];
switches_directions?: {
[key: string]: string;
};
}[];
export type PostInfraByIdPathfindingApiArg = {
/** Infra ID */
id: number;
/** Maximum number of paths to return */
number?: number;
/** Starting and ending track location */
body: {
starting?: TrackLocation & {
direction?: Direction;
};
ending?: TrackLocation;
};
};
export type PostInfraByIdObjectsAndObjectTypeApiResponse = /** status 200 No content */ {
railjson: Railjson;
geographic: Geometry;
schematic: Geometry;
}[];
export type PostInfraByIdObjectsAndObjectTypeApiArg = {
/** Infra id */
id: number;
/** The type of the object */
objectType: ObjectType;
/** List of object id's */
body: string[];
};
export type PostInfraByIdCloneApiResponse = /** status 201 The duplicated infra id */ {
id?: number;
};
export type PostInfraByIdCloneApiArg = {
/** Infra id */
id: number;
/** New infra name */
name: string;
};
export type GetElectricalProfileSetApiResponse =
/** status 200 The list of ids and names of electrical profile sets available */ {
id: number;
name: string;
}[];
export type GetElectricalProfileSetApiArg = void;
export type PostElectricalProfileSetApiResponse =
/** status 200 The list of ids and names of electrical profile sets available */ ElectricalProfile;
export type PostElectricalProfileSetApiArg = {
name: string;
};
export type GetElectricalProfileSetByIdApiResponse =
/** status 200 The list of electrical profiles in the set */ ElectricalProfile[];
export type GetElectricalProfileSetByIdApiArg = {
/** Electrical profile set ID */
id: number;
};
export type GetElectricalProfileSetByIdLevelOrderApiResponse =
/** status 200 A dictionary mapping catenary modes to a list of electrical profiles ordered by decreasing strength */ {
[key: string]: string[];
};
export type GetElectricalProfileSetByIdLevelOrderApiArg = {
/** Electrical profile set ID */
id: number;
};
export type GetDocumentsByKeyApiResponse = unknown;
export type GetDocumentsByKeyApiArg = {
/** A key identifying the document */
key: number;
};
export type DeleteDocumentsByKeyApiResponse = unknown;
export type DeleteDocumentsByKeyApiArg = {
/** A key identifying the document */
key: number;
};
export type PostDocumentsApiResponse = /** status 201 The key of the added document */ {
document_key?: number;
};
export type PostDocumentsApiArg = void;
export type GetLightRollingStockApiResponse = /** status 200 The rolling stock list */ {
count?: number;
next?: any;
previous?: any;
results: LightRollingStock[];
};
export type GetLightRollingStockApiArg = {
/** Page number */
page?: number;
/** Number of elements by page */
pageSize?: number;
};
export type GetLightRollingStockByIdApiResponse =
/** status 200 The rolling stock with their simplified effort curves */ LightRollingStock;
export type GetLightRollingStockByIdApiArg = {
/** Rolling Stock ID */
id: number;
};
export type PostPathfindingApiResponse = /** status 201 The created Path */ Path;
export type PostPathfindingApiArg = {
/** Path information */
pathQuery: PathQuery;
};
export type GetPathfindingByIdApiResponse = /** status 200 The retrieved path */ Path;
export type GetPathfindingByIdApiArg = {
/** Path ID */
id: number;
};
export type PutPathfindingByIdApiResponse = /** status 200 The updated path */ Path[];
export type PutPathfindingByIdApiArg = {
/** Path ID */
id: number;
/** Updated Path */
pathQuery: PathQuery;
};
export type DeletePathfindingByIdApiResponse = unknown;
export type DeletePathfindingByIdApiArg = {
/** Path ID */
id: number;
};
export type PostRollingStockApiResponse = /** status 200 The created rolling stock */ RollingStock;
export type PostRollingStockApiArg = {
/** whether or not the rolling_stock can be edited/deleted. */
locked?: boolean;
rollingStockUpsertPayload: RollingStockUpsertPayload;
};
export type GetRollingStockByIdApiResponse =
/** status 200 The rolling stock information */ RollingStock;
export type GetRollingStockByIdApiArg = {
/** Rolling Stock ID */
id: number;
};
export type PatchRollingStockByIdApiResponse =
/** status 200 The updated rolling stock */ RollingStock;
export type PatchRollingStockByIdApiArg = {
/** Rolling Stock ID */
id: number;
rollingStockUpsertPayload: RollingStockUpsertPayload;
};
export type DeleteRollingStockByIdApiResponse = /** status 204 No content */ undefined;
export type DeleteRollingStockByIdApiArg = {
/** rolling_stock id */
id: number;
/** force the deletion even if it’s used */
force?: boolean;
};
export type PatchRollingStockByIdLockedApiResponse = unknown;
export type PatchRollingStockByIdLockedApiArg = {
/** Rolling_stock id */
id: number;
/** New locked value */
body: {
locked?: boolean;
};
};
export type PostRollingStockByIdLiveryApiResponse =
/** status 200 The rolling stock livery */ RollingStockLivery;
export type PostRollingStockByIdLiveryApiArg = {
/** Rolling Stock ID */
id: number;
body: {
name?: string;
images?: Blob[];
};
};
export type PostProjectsApiResponse = /** status 201 The created project */ ProjectResult;
export type PostProjectsApiArg = {
projectCreateRequest: ProjectCreateRequest;
};
export type GetProjectsApiResponse = /** status 200 the project list */ {
count?: number;
next?: any;
previous?: any;
results?: ProjectResult[];
};
export type GetProjectsApiArg = {
ordering?:
| 'NameAsc'
| 'NameDesc'
| 'CreationDateAsc'
| 'CreationDateDesc'
| 'LastModifiedAsc'
| 'LastModifiedDesc';
/** Filter projects by name */
name?: string;
/** Filter projects by description */
description?: string;
/** Filter projects by tags */
tags?: string;
/** Page number */
page?: number;
/** Number of elements by page */
pageSize?: number;
};