forked from CMS-Enterprise/SONAR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SonarClient.g.cs
6089 lines (5453 loc) · 359 KB
/
SonarClient.g.cs
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
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
using Cms.BatCave.Sonar.Models;
using Cms.BatCave.Sonar.Enumeration;
using DateTimeHealthStatusValueTuple=System.ValueTuple<System.String, System.DateTime>;
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
namespace Cms.BatCave.Sonar.Agent
{
using System = global::System;
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial interface ISonarClient
{
/// <summary>
/// Creates and records configuration for new API key. The user performing this request must have sufficient
/// <br/>permissions to the requested environment/tenant.
/// </summary>
/// <param name="body">The API key type and, if they exist, environment and tenant.</param>
/// <returns>The API key details led to a successful API key creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ApiKeyConfiguration> KeysAsync(ApiKeyDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Creates and records configuration for new API key. The user performing this request must have sufficient
/// <br/>permissions to the requested environment/tenant.
/// </summary>
/// <param name="body">The API key type and, if they exist, environment and tenant.</param>
/// <returns>The API key details led to a successful API key creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ApiKeyConfiguration> KeysAsync(ApiKeyDetails body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get API keys.
/// </summary>
/// <returns>The key resources have been fetched and transmitted in the message body.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ApiKeyConfiguration>> KeysAllAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get API keys.
/// </summary>
/// <returns>The key resources have been fetched and transmitted in the message body.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ApiKeyConfiguration>> KeysAllAsync(System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Deletes existing API key.
/// </summary>
/// <param name="keyId">ID of the key to delete</param>
/// <returns>The API key configuration led to a successful deletion.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteApiKeyAsync(System.Guid keyId);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Deletes existing API key.
/// </summary>
/// <param name="keyId">ID of the key to delete</param>
/// <returns>The API key configuration led to a successful deletion.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteApiKeyAsync(System.Guid keyId, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Retrieves the configuration for the specified environment and tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <returns>The tenant configuration was found and will be returned.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> GetTenantAsync(string environment, string tenant);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Retrieves the configuration for the specified environment and tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <returns>The tenant configuration was found and will be returned.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> GetTenantAsync(string environment, string tenant, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Sets the configuration for a new environment or tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="body">The new service hierarchy configuration.</param>
/// <returns>The tenant configuration successfully created.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> CreateTenantAsync(string environment, string tenant, ServiceHierarchyConfiguration body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Sets the configuration for a new environment or tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="body">The new service hierarchy configuration.</param>
/// <returns>The tenant configuration successfully created.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> CreateTenantAsync(string environment, string tenant, ServiceHierarchyConfiguration body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Updates the configuration for an existing tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="body">The updated service hierarchy configuration.</param>
/// <returns>The tenant configuration was found and will be returned.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> UpdateTenantAsync(string environment, string tenant, ServiceHierarchyConfiguration body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Updates the configuration for an existing tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="body">The updated service hierarchy configuration.</param>
/// <returns>The tenant configuration was found and will be returned.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyConfiguration> UpdateTenantAsync(string environment, string tenant, ServiceHierarchyConfiguration body, System.Threading.CancellationToken cancellationToken);
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteTenantAsync(string environment, string tenant);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteTenantAsync(string environment, string tenant, System.Threading.CancellationToken cancellationToken);
/// <returns>Created</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentModel> CreateEnvironmentAsync(EnvironmentModel body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Created</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentModel> CreateEnvironmentAsync(EnvironmentModel body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Fetch a list of all environments and their current sonar aggregate health status.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<EnvironmentHealth>> GetEnvironmentsAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Fetch a list of all environments and their current sonar aggregate health status.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<EnvironmentHealth>> GetEnvironmentsAsync(System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Update environment.
/// </summary>
/// <param name="environment">The name of the environment updating.</param>
/// <param name="body">The body contains Json of type Environment Model. The Name is required but is not used or validated. The environment name from the address route(URL) is used.</param>
/// <returns>The environment has been updated.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentModel> UpdateEnvironmentAsync(string environment, EnvironmentModel body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Update environment.
/// </summary>
/// <param name="environment">The name of the environment updating.</param>
/// <param name="body">The body contains Json of type Environment Model. The Name is required but is not used or validated. The environment name from the address route(URL) is used.</param>
/// <returns>The environment has been updated.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentModel> UpdateEnvironmentAsync(string environment, EnvironmentModel body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Fetch a single environment's current sonar aggregate health status.
/// </summary>
/// <param name="environment">Environment name that the user is querying.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentHealth> GetEnvironmentAsync(string environment);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Fetch a single environment's current sonar aggregate health status.
/// </summary>
/// <param name="environment">Environment name that the user is querying.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<EnvironmentHealth> GetEnvironmentAsync(string environment, System.Threading.CancellationToken cancellationToken);
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteEnvironmentAsync(string environment);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteEnvironmentAsync(string environment, System.Threading.CancellationToken cancellationToken);
/// <returns>Accepted</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ErrorReportDetails> CreateErrorReportAsync(string environment, ErrorReportDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Accepted</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ErrorReportDetails> CreateErrorReportAsync(string environment, ErrorReportDetails body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ErrorReportDetails>> ListErrorReportsAsync(string environment, string serviceName, string healthCheckName, AgentErrorLevel? errorLevel, AgentErrorType? errorType, System.DateTimeOffset? start, System.DateTimeOffset? end);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ErrorReportDetails>> ListErrorReportsAsync(string environment, string serviceName, string healthCheckName, AgentErrorLevel? errorLevel, AgentErrorType? errorType, System.DateTimeOffset? start, System.DateTimeOffset? end, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ErrorReportDetails>> ListErrorReportsForTenantAsync(string environment, string tenant, string serviceName, string healthCheckName, AgentErrorLevel? errorLevel, AgentErrorType? errorType, System.DateTimeOffset? start, System.DateTimeOffset? end);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ErrorReportDetails>> ListErrorReportsForTenantAsync(string environment, string tenant, string serviceName, string healthCheckName, AgentErrorLevel? errorLevel, AgentErrorType? errorType, System.DateTimeOffset? start, System.DateTimeOffset? end, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Records a single health status for the specified service.
/// </summary>
/// <remarks>
/// Service health status information must be recorded in chronological order per-service, and cannot
/// <br/>be recorded for timestamps older than 2 hours. Timestamps greater than 2 hours will result in an
/// <br/>"out of bounds" error. Health status that is reported out of order will result in an "out of
/// <br/>order sample" error.
/// </remarks>
/// <returns>The service health status was successfully recorded.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RecordStatusAsync(string environment, string tenant, string service, ServiceHealth body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Records a single health status for the specified service.
/// </summary>
/// <remarks>
/// Service health status information must be recorded in chronological order per-service, and cannot
/// <br/>be recorded for timestamps older than 2 hours. Timestamps greater than 2 hours will result in an
/// <br/>"out of bounds" error. Health status that is reported out of order will result in an "out of
/// <br/>order sample" error.
/// </remarks>
/// <returns>The service health status was successfully recorded.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RecordStatusAsync(string environment, string tenant, string service, ServiceHealth body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetSonarHealthAsync(string environment);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetSonarHealthAsync(string environment, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetServiceHierarchyHealthAsync(string environment, string tenant);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetServiceHierarchyHealthAsync(string environment, string tenant, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetSpecificServiceHierarchyHealthAsync(string environment, string tenant, string servicePath);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealth>> GetSpecificServiceHierarchyHealthAsync(string environment, string tenant, string servicePath, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Record the given raw Cms.BatCave.Sonar.Models.ServiceHealthData time series samples for the given environment,
/// <br/>tenant, and service in Prometheus. Filters out stale and out-of-order samples prior to calling P8s.
/// </summary>
/// <param name="environment">The environment the data belongs to.</param>
/// <param name="tenant">The tenant the data belongs to.</param>
/// <param name="service">The service the data belongs to.</param>
/// <param name="body">The health check data to be written.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHealthData> RecordHealthCheckDataAsync(string environment, string tenant, string service, ServiceHealthData body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Record the given raw Cms.BatCave.Sonar.Models.ServiceHealthData time series samples for the given environment,
/// <br/>tenant, and service in Prometheus. Filters out stale and out-of-order samples prior to calling P8s.
/// </summary>
/// <param name="environment">The environment the data belongs to.</param>
/// <param name="tenant">The tenant the data belongs to.</param>
/// <param name="service">The service the data belongs to.</param>
/// <param name="body">The health check data to be written.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHealthData> RecordHealthCheckDataAsync(string environment, string tenant, string service, ServiceHealthData body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Retrieves the given raw Cms.BatCave.Sonar.Models.ServiceHealthData time series samples for the given environment,
/// <br/>tenant, service, and health check in Prometheus. Filters out samples outside of the given start and end date time
/// <br/>(or if those are not given, filters out samples from more than 10 minutes ago UTC) prior to calling P8s.
/// </summary>
/// <param name="environment">The environment to get timestamps for.</param>
/// <param name="tenant">The tenant to get timestamps for.</param>
/// <param name="service">The service to get timestamps for.</param>
/// <param name="healthCheck">The name of the health check to get timestamps for.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<MetricDataCollection> GetHealthCheckDataAsync(string environment, string tenant, string service, string healthCheck, System.DateTimeOffset? queryStart, System.DateTimeOffset? queryEnd);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Retrieves the given raw Cms.BatCave.Sonar.Models.ServiceHealthData time series samples for the given environment,
/// <br/>tenant, service, and health check in Prometheus. Filters out samples outside of the given start and end date time
/// <br/>(or if those are not given, filters out samples from more than 10 minutes ago UTC) prior to calling P8s.
/// </summary>
/// <param name="environment">The environment to get timestamps for.</param>
/// <param name="tenant">The tenant to get timestamps for.</param>
/// <param name="service">The service to get timestamps for.</param>
/// <param name="healthCheck">The name of the health check to get timestamps for.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<MetricDataCollection> GetHealthCheckDataAsync(string environment, string tenant, string service, string healthCheck, System.DateTimeOffset? queryStart, System.DateTimeOffset? queryEnd, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Retrieves the instantaneous prometheus health status for each healthcheck given the service at a specific time.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, DateTimeHealthStatusValueTuple>> GetHealthCheckResultForServiceAsync(string environment, string tenant, string service, System.DateTimeOffset? timeQuery);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Retrieves the instantaneous prometheus health status for each healthcheck given the service at a specific time.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.IDictionary<string, DateTimeHealthStatusValueTuple>> GetHealthCheckResultForServiceAsync(string environment, string tenant, string service, System.DateTimeOffset? timeQuery, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Retrieves the prometheus health status time series for each healthcheck given the
/// <br/>service. Filters out samples outside of the given start and end date time.
/// </summary>
/// <param name="environment">The environment to get timestamps for.</param>
/// <param name="tenant">The tenant to get timestamps for.</param>
/// <param name="service">The service to get timestamps for.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthCheckHistory> GetHealthCheckResultsForServiceAsync(string environment, string tenant, string service, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Retrieves the prometheus health status time series for each healthcheck given the
/// <br/>service. Filters out samples outside of the given start and end date time.
/// </summary>
/// <param name="environment">The environment to get timestamps for.</param>
/// <param name="tenant">The tenant to get timestamps for.</param>
/// <param name="service">The service to get timestamps for.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<HealthCheckHistory> GetHealthCheckResultsForServiceAsync(string environment, string tenant, string service, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get the health history for all services within the specified Tenant.
/// </summary>
/// <param name="start">The queries first evaluation time. The start and end time cannot be greater
/// <br/>than 24 hours (default is current time)</param>
/// <param name="end">The queries evaluation time stops on or before this time. The start and end time
/// <br/>cannot be greater than 24 hours (default is current time minus 1 hour)</param>
/// <param name="step">The number of seconds that is incremented on each step. Step cannot be greater
/// <br/>than 3600 (default 30)</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealthHistory>> GetServicesHealthHistoryAsync(string environment, string tenant, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get the health history for all services within the specified Tenant.
/// </summary>
/// <param name="start">The queries first evaluation time. The start and end time cannot be greater
/// <br/>than 24 hours (default is current time)</param>
/// <param name="end">The queries evaluation time stops on or before this time. The start and end time
/// <br/>cannot be greater than 24 hours (default is current time minus 1 hour)</param>
/// <param name="step">The number of seconds that is incremented on each step. Step cannot be greater
/// <br/>than 3600 (default 30)</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceHierarchyHealthHistory>> GetServicesHealthHistoryAsync(string environment, string tenant, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get the health history for a specific service, specified by its path in the service hierarchy.
/// </summary>
/// <remarks>
/// Get the health history for a specific service and its children.
/// </remarks>
/// <param name="start">The queries first evaluation time. The start and end time cannot be greater
/// <br/>than 24 hours (default is current time)</param>
/// <param name="end">The queries evaluation time stops on or before this time. The start and end time
/// <br/>cannot be greater than 24 hours (default is current time minus 1 hour)</param>
/// <param name="step">The number of seconds that is incremented on each step. Step cannot be greater
/// <br/>than 3600 (default 30)</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyHealthHistory> GetServiceHealthHistoryAsync(string environment, string tenant, string servicePath, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get the health history for a specific service, specified by its path in the service hierarchy.
/// </summary>
/// <remarks>
/// Get the health history for a specific service and its children.
/// </remarks>
/// <param name="start">The queries first evaluation time. The start and end time cannot be greater
/// <br/>than 24 hours (default is current time)</param>
/// <param name="end">The queries evaluation time stops on or before this time. The start and end time
/// <br/>cannot be greater than 24 hours (default is current time minus 1 hour)</param>
/// <param name="step">The number of seconds that is incremented on each step. Step cannot be greater
/// <br/>than 3600 (default 30)</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceHierarchyHealthHistory> GetServiceHealthHistoryAsync(string environment, string tenant, string servicePath, System.DateTimeOffset? start, System.DateTimeOffset? end, int? step, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocEnvironmentMaintenanceAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocEnvironmentMaintenanceAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocTenantMaintenanceAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocTenantMaintenanceAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocServiceMaintenanceAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ActiveAdHocMaintenanceView>> GetActiveAdHocServiceMaintenanceAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocEnvironmentMaintenanceAsync(string environment, AdHocMaintenanceConfiguration body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocEnvironmentMaintenanceAsync(string environment, AdHocMaintenanceConfiguration body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocTenantMaintenanceAsync(string environment, string tenant, AdHocMaintenanceConfiguration body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocTenantMaintenanceAsync(string environment, string tenant, AdHocMaintenanceConfiguration body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocServiceMaintenanceAsync(string environment, string tenant, string service, AdHocMaintenanceConfiguration body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ActiveAdHocMaintenanceView> ToggleAdhocServiceMaintenanceAsync(string environment, string tenant, string service, AdHocMaintenanceConfiguration body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceAlert>> GetServiceAlertsAsync(string environment, string tenant, string servicePath);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceAlert>> GetServiceAlertsAsync(string environment, string tenant, string servicePath, System.Threading.CancellationToken cancellationToken);
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task CreateUpdateSilenceAsync(string environment, string tenant, string servicePath, AlertSilenceDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task CreateUpdateSilenceAsync(string environment, string tenant, string servicePath, AlertSilenceDetails body, System.Threading.CancellationToken cancellationToken);
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RemoveSilenceAsync(string environment, string tenant, string servicePath, AlertSilenceDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>No Content</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RemoveSilenceAsync(string environment, string tenant, string servicePath, AlertSilenceDetails body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Fetch tenant health. Query parameters may be supplied to query by environment and/or tenant. This endpoint
/// <br/>will return all tenants for all environments if query params aren't supplied.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TenantInfo>> GetTenantsAsync(string environment, string tenant);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Fetch tenant health. Query parameters may be supplied to query by environment and/or tenant. This endpoint
/// <br/>will return all tenants for all environments if query params aren't supplied.
/// </summary>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<TenantInfo>> GetTenantsAsync(string environment, string tenant, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<UptimeModel>> GetTotalUptimeAsync(string environment, string tenant, string servicePath, string threshold, System.DateTimeOffset? start, System.DateTimeOffset? end);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<UptimeModel>> GetTotalUptimeAsync(string environment, string tenant, string servicePath, string threshold, System.DateTimeOffset? start, System.DateTimeOffset? end, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<CurrentUserView> UserAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<CurrentUserView> UserAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<CurrentUserView>> UserAllAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<CurrentUserView>> UserAllAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<UserPermissionsView> GetUserPermissionTreeAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<UserPermissionsView> GetUserPermissionTreeAsync(System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Create a user permission. The user performing the request must have sufficient permissions
/// <br/>to the requested environment/tenant.
/// </summary>
/// <param name="body">Add permission for specified user(email)</param>
/// <returns>The parameters led to a successful permission creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task PermissionsAsync(PermissionDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Create a user permission. The user performing the request must have sufficient permissions
/// <br/>to the requested environment/tenant.
/// </summary>
/// <param name="body">Add permission for specified user(email)</param>
/// <returns>The parameters led to a successful permission creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task PermissionsAsync(PermissionDetails body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get permissions the current user has access to.
/// </summary>
/// <returns>successfully retrieved permissions.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<PermissionConfiguration>> GetPermissionsAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get permissions the current user has access to.
/// </summary>
/// <returns>successfully retrieved permissions.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<PermissionConfiguration>> GetPermissionsAsync(System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Delete a user permission.
/// </summary>
/// <param name="permissionId">ID of permission to delete</param>
/// <returns>The user permission successfully deleted.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteUserPermissionAsync(System.Guid permissionId);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Delete a user permission.
/// </summary>
/// <param name="permissionId">ID of permission to delete</param>
/// <returns>The user permission successfully deleted.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task DeleteUserPermissionAsync(System.Guid permissionId, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Update a user permission.
/// </summary>
/// <param name="permissionId">ID of user permission to update</param>
/// <param name="body">Add permission for specified user(email)</param>
/// <returns>The user permission has been updated.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task UpdateUserPermissionAsync(System.Guid permissionId, PermissionDetails body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Update a user permission.
/// </summary>
/// <param name="permissionId">ID of user permission to update</param>
/// <param name="body">Add permission for specified user(email)</param>
/// <returns>The user permission has been updated.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task UpdateUserPermissionAsync(System.Guid permissionId, PermissionDetails body, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get permissions of the current user.
/// </summary>
/// <returns>Successfully retrieved current user permissions.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<PermissionConfiguration>> GetCurrentUserAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get permissions of the current user.
/// </summary>
/// <returns>Successfully retrieved current user permissions.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<PermissionConfiguration>> GetCurrentUserAsync(System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Records a single version for the specified service.
/// </summary>
/// <returns>The service version was successfully recorded.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RecordServiceVersionAsync(string environment, string tenant, string service, ServiceVersion body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Records a single version for the specified service.
/// </summary>
/// <returns>The service version was successfully recorded.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task RecordServiceVersionAsync(string environment, string tenant, string service, ServiceVersion body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceVersionDetails>> GetSpecificServiceVersionDetailsAsync(string environment, string tenant, string servicePath);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceVersionDetails>> GetSpecificServiceVersionDetailsAsync(string environment, string tenant, string servicePath, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get the version history for all services within the specified Tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="duration">How far back in time values should be fetched (in seconds).</param>
/// <param name="timeQuery">The timestamp at which to sample data.</param>
/// <returns>Successfully retrieved the version history for all the Tenant's services.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceVersionHistory>> GetServicesVersionHistoryAsync(string environment, string tenant, int? duration, System.DateTimeOffset? timeQuery);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get the version history for all services within the specified Tenant.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="duration">How far back in time values should be fetched (in seconds).</param>
/// <param name="timeQuery">The timestamp at which to sample data.</param>
/// <returns>Successfully retrieved the version history for all the Tenant's services.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ServiceVersionHistory>> GetServicesVersionHistoryAsync(string environment, string tenant, int? duration, System.DateTimeOffset? timeQuery, System.Threading.CancellationToken cancellationToken);
/// <summary>
/// Get the version history for a specific Service, specified by its path in the service hierarchy.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="servicePath">The path to the service in the service hierarchy.</param>
/// <param name="duration">How far back in time values should be fetched (in seconds).</param>
/// <param name="timeQuery">The timestamp at which to sample data.</param>
/// <returns>Successfully retrieved the version history for the specified Service.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceVersionHistory> GetServiceVersionHistoryAsync(string environment, string tenant, string servicePath, int? duration, System.DateTimeOffset? timeQuery);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get the version history for a specific Service, specified by its path in the service hierarchy.
/// </summary>
/// <param name="environment">The name of the environment.</param>
/// <param name="tenant">The name of the tenant.</param>
/// <param name="servicePath">The path to the service in the service hierarchy.</param>
/// <param name="duration">How far back in time values should be fetched (in seconds).</param>
/// <param name="timeQuery">The timestamp at which to sample data.</param>
/// <returns>Successfully retrieved the version history for the specified Service.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<ServiceVersionHistory> GetServiceVersionHistoryAsync(string environment, string tenant, string servicePath, int? duration, System.DateTimeOffset? timeQuery, System.Threading.CancellationToken cancellationToken);
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class SonarClient : ISonarClient
{
private string _baseUrl = "";
private System.Net.Http.HttpClient _httpClient;
private System.Lazy<System.Text.Json.JsonSerializerOptions> _settings;
public SonarClient(string baseUrl, System.Net.Http.HttpClient httpClient)
{
BaseUrl = baseUrl;
_httpClient = httpClient;
_settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings);
}
private System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
{
var settings = new System.Text.Json.JsonSerializerOptions();
UpdateJsonSerializerSettings(settings);
return settings;
}
public string BaseUrl
{
get { return _baseUrl; }
set { _baseUrl = value; }
}
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } }
partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
/// <summary>
/// Creates and records configuration for new API key. The user performing this request must have sufficient
/// <br/>permissions to the requested environment/tenant.
/// </summary>
/// <param name="body">The API key type and, if they exist, environment and tenant.</param>
/// <returns>The API key details led to a successful API key creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<ApiKeyConfiguration> KeysAsync(ApiKeyDetails body)
{
return KeysAsync(body, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Creates and records configuration for new API key. The user performing this request must have sufficient
/// <br/>permissions to the requested environment/tenant.
/// </summary>
/// <param name="body">The API key type and, if they exist, environment and tenant.</param>
/// <returns>The API key details led to a successful API key creation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<ApiKeyConfiguration> KeysAsync(ApiKeyDetails body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/v2/keys");
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = System.Text.Json.JsonSerializer.Serialize(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 201)
{
var objectResponse_ = await ReadObjectResponseAsync<ApiKeyConfiguration>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("The API key details are not valid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 401)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("The API key in the header is not authorized for creating an API key.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <summary>
/// Get API keys.
/// </summary>
/// <returns>The key resources have been fetched and transmitted in the message body.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ApiKeyConfiguration>> KeysAllAsync()
{
return KeysAllAsync(System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Get API keys.
/// </summary>
/// <returns>The key resources have been fetched and transmitted in the message body.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<ApiKeyConfiguration>> KeysAllAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/v2/keys");
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<ApiKeyConfiguration>>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("The API key details are not valid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 401)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("The API key in the header is not authorized for creating an API key.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <summary>
/// Deletes existing API key.
/// </summary>
/// <param name="keyId">ID of the key to delete</param>
/// <returns>The API key configuration led to a successful deletion.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task DeleteApiKeyAsync(System.Guid keyId)
{
return DeleteApiKeyAsync(keyId, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <summary>
/// Deletes existing API key.
/// </summary>
/// <param name="keyId">ID of the key to delete</param>
/// <returns>The API key configuration led to a successful deletion.</returns>