-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathCdcClient.cpp
More file actions
1192 lines (1093 loc) · 43.9 KB
/
CdcClient.cpp
File metadata and controls
1192 lines (1093 loc) · 43.9 KB
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
/*
* Copyright (c) 2017-2025 Tencent. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <tencentcloud/cdc/v20201214/CdcClient.h>
#include <tencentcloud/core/Executor.h>
#include <tencentcloud/core/Runnable.h>
using namespace TencentCloud;
using namespace TencentCloud::Cdc::V20201214;
using namespace TencentCloud::Cdc::V20201214::Model;
using namespace std;
namespace
{
const string VERSION = "2020-12-14";
const string ENDPOINT = "cdc.tencentcloudapi.com";
}
CdcClient::CdcClient(const Credential &credential, const string ®ion) :
CdcClient(credential, region, ClientProfile())
{
}
CdcClient::CdcClient(const Credential &credential, const string ®ion, const ClientProfile &profile) :
AbstractClient(ENDPOINT, VERSION, credential, region, profile)
{
}
CdcClient::CreateDedicatedClusterOutcome CdcClient::CreateDedicatedCluster(const CreateDedicatedClusterRequest &request)
{
auto outcome = MakeRequest(request, "CreateDedicatedCluster");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateDedicatedClusterResponse rsp = CreateDedicatedClusterResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateDedicatedClusterOutcome(rsp);
else
return CreateDedicatedClusterOutcome(o.GetError());
}
else
{
return CreateDedicatedClusterOutcome(outcome.GetError());
}
}
void CdcClient::CreateDedicatedClusterAsync(const CreateDedicatedClusterRequest& request, const CreateDedicatedClusterAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const CreateDedicatedClusterRequest&;
using Resp = CreateDedicatedClusterResponse;
DoRequestAsync<Req, Resp>(
"CreateDedicatedCluster", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::CreateDedicatedClusterOutcomeCallable CdcClient::CreateDedicatedClusterCallable(const CreateDedicatedClusterRequest &request)
{
const auto prom = std::make_shared<std::promise<CreateDedicatedClusterOutcome>>();
CreateDedicatedClusterAsync(
request,
[prom](
const CdcClient*,
const CreateDedicatedClusterRequest&,
CreateDedicatedClusterOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::CreateDedicatedClusterImageCacheOutcome CdcClient::CreateDedicatedClusterImageCache(const CreateDedicatedClusterImageCacheRequest &request)
{
auto outcome = MakeRequest(request, "CreateDedicatedClusterImageCache");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateDedicatedClusterImageCacheResponse rsp = CreateDedicatedClusterImageCacheResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateDedicatedClusterImageCacheOutcome(rsp);
else
return CreateDedicatedClusterImageCacheOutcome(o.GetError());
}
else
{
return CreateDedicatedClusterImageCacheOutcome(outcome.GetError());
}
}
void CdcClient::CreateDedicatedClusterImageCacheAsync(const CreateDedicatedClusterImageCacheRequest& request, const CreateDedicatedClusterImageCacheAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const CreateDedicatedClusterImageCacheRequest&;
using Resp = CreateDedicatedClusterImageCacheResponse;
DoRequestAsync<Req, Resp>(
"CreateDedicatedClusterImageCache", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::CreateDedicatedClusterImageCacheOutcomeCallable CdcClient::CreateDedicatedClusterImageCacheCallable(const CreateDedicatedClusterImageCacheRequest &request)
{
const auto prom = std::make_shared<std::promise<CreateDedicatedClusterImageCacheOutcome>>();
CreateDedicatedClusterImageCacheAsync(
request,
[prom](
const CdcClient*,
const CreateDedicatedClusterImageCacheRequest&,
CreateDedicatedClusterImageCacheOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::CreateDedicatedClusterOrderOutcome CdcClient::CreateDedicatedClusterOrder(const CreateDedicatedClusterOrderRequest &request)
{
auto outcome = MakeRequest(request, "CreateDedicatedClusterOrder");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateDedicatedClusterOrderResponse rsp = CreateDedicatedClusterOrderResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateDedicatedClusterOrderOutcome(rsp);
else
return CreateDedicatedClusterOrderOutcome(o.GetError());
}
else
{
return CreateDedicatedClusterOrderOutcome(outcome.GetError());
}
}
void CdcClient::CreateDedicatedClusterOrderAsync(const CreateDedicatedClusterOrderRequest& request, const CreateDedicatedClusterOrderAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const CreateDedicatedClusterOrderRequest&;
using Resp = CreateDedicatedClusterOrderResponse;
DoRequestAsync<Req, Resp>(
"CreateDedicatedClusterOrder", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::CreateDedicatedClusterOrderOutcomeCallable CdcClient::CreateDedicatedClusterOrderCallable(const CreateDedicatedClusterOrderRequest &request)
{
const auto prom = std::make_shared<std::promise<CreateDedicatedClusterOrderOutcome>>();
CreateDedicatedClusterOrderAsync(
request,
[prom](
const CdcClient*,
const CreateDedicatedClusterOrderRequest&,
CreateDedicatedClusterOrderOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::CreateSiteOutcome CdcClient::CreateSite(const CreateSiteRequest &request)
{
auto outcome = MakeRequest(request, "CreateSite");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateSiteResponse rsp = CreateSiteResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateSiteOutcome(rsp);
else
return CreateSiteOutcome(o.GetError());
}
else
{
return CreateSiteOutcome(outcome.GetError());
}
}
void CdcClient::CreateSiteAsync(const CreateSiteRequest& request, const CreateSiteAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const CreateSiteRequest&;
using Resp = CreateSiteResponse;
DoRequestAsync<Req, Resp>(
"CreateSite", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::CreateSiteOutcomeCallable CdcClient::CreateSiteCallable(const CreateSiteRequest &request)
{
const auto prom = std::make_shared<std::promise<CreateSiteOutcome>>();
CreateSiteAsync(
request,
[prom](
const CdcClient*,
const CreateSiteRequest&,
CreateSiteOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DeleteDedicatedClusterImageCacheOutcome CdcClient::DeleteDedicatedClusterImageCache(const DeleteDedicatedClusterImageCacheRequest &request)
{
auto outcome = MakeRequest(request, "DeleteDedicatedClusterImageCache");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteDedicatedClusterImageCacheResponse rsp = DeleteDedicatedClusterImageCacheResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteDedicatedClusterImageCacheOutcome(rsp);
else
return DeleteDedicatedClusterImageCacheOutcome(o.GetError());
}
else
{
return DeleteDedicatedClusterImageCacheOutcome(outcome.GetError());
}
}
void CdcClient::DeleteDedicatedClusterImageCacheAsync(const DeleteDedicatedClusterImageCacheRequest& request, const DeleteDedicatedClusterImageCacheAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DeleteDedicatedClusterImageCacheRequest&;
using Resp = DeleteDedicatedClusterImageCacheResponse;
DoRequestAsync<Req, Resp>(
"DeleteDedicatedClusterImageCache", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DeleteDedicatedClusterImageCacheOutcomeCallable CdcClient::DeleteDedicatedClusterImageCacheCallable(const DeleteDedicatedClusterImageCacheRequest &request)
{
const auto prom = std::make_shared<std::promise<DeleteDedicatedClusterImageCacheOutcome>>();
DeleteDedicatedClusterImageCacheAsync(
request,
[prom](
const CdcClient*,
const DeleteDedicatedClusterImageCacheRequest&,
DeleteDedicatedClusterImageCacheOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DeleteDedicatedClustersOutcome CdcClient::DeleteDedicatedClusters(const DeleteDedicatedClustersRequest &request)
{
auto outcome = MakeRequest(request, "DeleteDedicatedClusters");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteDedicatedClustersResponse rsp = DeleteDedicatedClustersResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteDedicatedClustersOutcome(rsp);
else
return DeleteDedicatedClustersOutcome(o.GetError());
}
else
{
return DeleteDedicatedClustersOutcome(outcome.GetError());
}
}
void CdcClient::DeleteDedicatedClustersAsync(const DeleteDedicatedClustersRequest& request, const DeleteDedicatedClustersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DeleteDedicatedClustersRequest&;
using Resp = DeleteDedicatedClustersResponse;
DoRequestAsync<Req, Resp>(
"DeleteDedicatedClusters", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DeleteDedicatedClustersOutcomeCallable CdcClient::DeleteDedicatedClustersCallable(const DeleteDedicatedClustersRequest &request)
{
const auto prom = std::make_shared<std::promise<DeleteDedicatedClustersOutcome>>();
DeleteDedicatedClustersAsync(
request,
[prom](
const CdcClient*,
const DeleteDedicatedClustersRequest&,
DeleteDedicatedClustersOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DeleteSitesOutcome CdcClient::DeleteSites(const DeleteSitesRequest &request)
{
auto outcome = MakeRequest(request, "DeleteSites");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteSitesResponse rsp = DeleteSitesResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteSitesOutcome(rsp);
else
return DeleteSitesOutcome(o.GetError());
}
else
{
return DeleteSitesOutcome(outcome.GetError());
}
}
void CdcClient::DeleteSitesAsync(const DeleteSitesRequest& request, const DeleteSitesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DeleteSitesRequest&;
using Resp = DeleteSitesResponse;
DoRequestAsync<Req, Resp>(
"DeleteSites", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DeleteSitesOutcomeCallable CdcClient::DeleteSitesCallable(const DeleteSitesRequest &request)
{
const auto prom = std::make_shared<std::promise<DeleteSitesOutcome>>();
DeleteSitesAsync(
request,
[prom](
const CdcClient*,
const DeleteSitesRequest&,
DeleteSitesOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterCbsStatisticsOutcome CdcClient::DescribeDedicatedClusterCbsStatistics(const DescribeDedicatedClusterCbsStatisticsRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterCbsStatistics");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterCbsStatisticsResponse rsp = DescribeDedicatedClusterCbsStatisticsResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterCbsStatisticsOutcome(rsp);
else
return DescribeDedicatedClusterCbsStatisticsOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterCbsStatisticsOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterCbsStatisticsAsync(const DescribeDedicatedClusterCbsStatisticsRequest& request, const DescribeDedicatedClusterCbsStatisticsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterCbsStatisticsRequest&;
using Resp = DescribeDedicatedClusterCbsStatisticsResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterCbsStatistics", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterCbsStatisticsOutcomeCallable CdcClient::DescribeDedicatedClusterCbsStatisticsCallable(const DescribeDedicatedClusterCbsStatisticsRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterCbsStatisticsOutcome>>();
DescribeDedicatedClusterCbsStatisticsAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterCbsStatisticsRequest&,
DescribeDedicatedClusterCbsStatisticsOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterCosCapacityOutcome CdcClient::DescribeDedicatedClusterCosCapacity(const DescribeDedicatedClusterCosCapacityRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterCosCapacity");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterCosCapacityResponse rsp = DescribeDedicatedClusterCosCapacityResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterCosCapacityOutcome(rsp);
else
return DescribeDedicatedClusterCosCapacityOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterCosCapacityOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterCosCapacityAsync(const DescribeDedicatedClusterCosCapacityRequest& request, const DescribeDedicatedClusterCosCapacityAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterCosCapacityRequest&;
using Resp = DescribeDedicatedClusterCosCapacityResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterCosCapacity", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterCosCapacityOutcomeCallable CdcClient::DescribeDedicatedClusterCosCapacityCallable(const DescribeDedicatedClusterCosCapacityRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterCosCapacityOutcome>>();
DescribeDedicatedClusterCosCapacityAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterCosCapacityRequest&,
DescribeDedicatedClusterCosCapacityOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterHostStatisticsOutcome CdcClient::DescribeDedicatedClusterHostStatistics(const DescribeDedicatedClusterHostStatisticsRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterHostStatistics");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterHostStatisticsResponse rsp = DescribeDedicatedClusterHostStatisticsResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterHostStatisticsOutcome(rsp);
else
return DescribeDedicatedClusterHostStatisticsOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterHostStatisticsOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterHostStatisticsAsync(const DescribeDedicatedClusterHostStatisticsRequest& request, const DescribeDedicatedClusterHostStatisticsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterHostStatisticsRequest&;
using Resp = DescribeDedicatedClusterHostStatisticsResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterHostStatistics", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterHostStatisticsOutcomeCallable CdcClient::DescribeDedicatedClusterHostStatisticsCallable(const DescribeDedicatedClusterHostStatisticsRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterHostStatisticsOutcome>>();
DescribeDedicatedClusterHostStatisticsAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterHostStatisticsRequest&,
DescribeDedicatedClusterHostStatisticsOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterHostsOutcome CdcClient::DescribeDedicatedClusterHosts(const DescribeDedicatedClusterHostsRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterHosts");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterHostsResponse rsp = DescribeDedicatedClusterHostsResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterHostsOutcome(rsp);
else
return DescribeDedicatedClusterHostsOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterHostsOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterHostsAsync(const DescribeDedicatedClusterHostsRequest& request, const DescribeDedicatedClusterHostsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterHostsRequest&;
using Resp = DescribeDedicatedClusterHostsResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterHosts", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterHostsOutcomeCallable CdcClient::DescribeDedicatedClusterHostsCallable(const DescribeDedicatedClusterHostsRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterHostsOutcome>>();
DescribeDedicatedClusterHostsAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterHostsRequest&,
DescribeDedicatedClusterHostsOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterInstanceTypesOutcome CdcClient::DescribeDedicatedClusterInstanceTypes(const DescribeDedicatedClusterInstanceTypesRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterInstanceTypes");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterInstanceTypesResponse rsp = DescribeDedicatedClusterInstanceTypesResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterInstanceTypesOutcome(rsp);
else
return DescribeDedicatedClusterInstanceTypesOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterInstanceTypesOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterInstanceTypesAsync(const DescribeDedicatedClusterInstanceTypesRequest& request, const DescribeDedicatedClusterInstanceTypesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterInstanceTypesRequest&;
using Resp = DescribeDedicatedClusterInstanceTypesResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterInstanceTypes", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterInstanceTypesOutcomeCallable CdcClient::DescribeDedicatedClusterInstanceTypesCallable(const DescribeDedicatedClusterInstanceTypesRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterInstanceTypesOutcome>>();
DescribeDedicatedClusterInstanceTypesAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterInstanceTypesRequest&,
DescribeDedicatedClusterInstanceTypesOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterOrdersOutcome CdcClient::DescribeDedicatedClusterOrders(const DescribeDedicatedClusterOrdersRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterOrders");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterOrdersResponse rsp = DescribeDedicatedClusterOrdersResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterOrdersOutcome(rsp);
else
return DescribeDedicatedClusterOrdersOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterOrdersOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterOrdersAsync(const DescribeDedicatedClusterOrdersRequest& request, const DescribeDedicatedClusterOrdersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterOrdersRequest&;
using Resp = DescribeDedicatedClusterOrdersResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterOrders", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterOrdersOutcomeCallable CdcClient::DescribeDedicatedClusterOrdersCallable(const DescribeDedicatedClusterOrdersRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterOrdersOutcome>>();
DescribeDedicatedClusterOrdersAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterOrdersRequest&,
DescribeDedicatedClusterOrdersOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterOverviewOutcome CdcClient::DescribeDedicatedClusterOverview(const DescribeDedicatedClusterOverviewRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterOverview");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterOverviewResponse rsp = DescribeDedicatedClusterOverviewResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterOverviewOutcome(rsp);
else
return DescribeDedicatedClusterOverviewOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterOverviewOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterOverviewAsync(const DescribeDedicatedClusterOverviewRequest& request, const DescribeDedicatedClusterOverviewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterOverviewRequest&;
using Resp = DescribeDedicatedClusterOverviewResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterOverview", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterOverviewOutcomeCallable CdcClient::DescribeDedicatedClusterOverviewCallable(const DescribeDedicatedClusterOverviewRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterOverviewOutcome>>();
DescribeDedicatedClusterOverviewAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterOverviewRequest&,
DescribeDedicatedClusterOverviewOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClusterTypesOutcome CdcClient::DescribeDedicatedClusterTypes(const DescribeDedicatedClusterTypesRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusterTypes");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClusterTypesResponse rsp = DescribeDedicatedClusterTypesResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClusterTypesOutcome(rsp);
else
return DescribeDedicatedClusterTypesOutcome(o.GetError());
}
else
{
return DescribeDedicatedClusterTypesOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClusterTypesAsync(const DescribeDedicatedClusterTypesRequest& request, const DescribeDedicatedClusterTypesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClusterTypesRequest&;
using Resp = DescribeDedicatedClusterTypesResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusterTypes", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClusterTypesOutcomeCallable CdcClient::DescribeDedicatedClusterTypesCallable(const DescribeDedicatedClusterTypesRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClusterTypesOutcome>>();
DescribeDedicatedClusterTypesAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClusterTypesRequest&,
DescribeDedicatedClusterTypesOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedClustersOutcome CdcClient::DescribeDedicatedClusters(const DescribeDedicatedClustersRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedClusters");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedClustersResponse rsp = DescribeDedicatedClustersResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedClustersOutcome(rsp);
else
return DescribeDedicatedClustersOutcome(o.GetError());
}
else
{
return DescribeDedicatedClustersOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedClustersAsync(const DescribeDedicatedClustersRequest& request, const DescribeDedicatedClustersAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedClustersRequest&;
using Resp = DescribeDedicatedClustersResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedClusters", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedClustersOutcomeCallable CdcClient::DescribeDedicatedClustersCallable(const DescribeDedicatedClustersRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedClustersOutcome>>();
DescribeDedicatedClustersAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedClustersRequest&,
DescribeDedicatedClustersOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeDedicatedSupportedZonesOutcome CdcClient::DescribeDedicatedSupportedZones(const DescribeDedicatedSupportedZonesRequest &request)
{
auto outcome = MakeRequest(request, "DescribeDedicatedSupportedZones");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeDedicatedSupportedZonesResponse rsp = DescribeDedicatedSupportedZonesResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeDedicatedSupportedZonesOutcome(rsp);
else
return DescribeDedicatedSupportedZonesOutcome(o.GetError());
}
else
{
return DescribeDedicatedSupportedZonesOutcome(outcome.GetError());
}
}
void CdcClient::DescribeDedicatedSupportedZonesAsync(const DescribeDedicatedSupportedZonesRequest& request, const DescribeDedicatedSupportedZonesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeDedicatedSupportedZonesRequest&;
using Resp = DescribeDedicatedSupportedZonesResponse;
DoRequestAsync<Req, Resp>(
"DescribeDedicatedSupportedZones", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeDedicatedSupportedZonesOutcomeCallable CdcClient::DescribeDedicatedSupportedZonesCallable(const DescribeDedicatedSupportedZonesRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeDedicatedSupportedZonesOutcome>>();
DescribeDedicatedSupportedZonesAsync(
request,
[prom](
const CdcClient*,
const DescribeDedicatedSupportedZonesRequest&,
DescribeDedicatedSupportedZonesOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeSitesOutcome CdcClient::DescribeSites(const DescribeSitesRequest &request)
{
auto outcome = MakeRequest(request, "DescribeSites");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeSitesResponse rsp = DescribeSitesResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeSitesOutcome(rsp);
else
return DescribeSitesOutcome(o.GetError());
}
else
{
return DescribeSitesOutcome(outcome.GetError());
}
}
void CdcClient::DescribeSitesAsync(const DescribeSitesRequest& request, const DescribeSitesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeSitesRequest&;
using Resp = DescribeSitesResponse;
DoRequestAsync<Req, Resp>(
"DescribeSites", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeSitesOutcomeCallable CdcClient::DescribeSitesCallable(const DescribeSitesRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeSitesOutcome>>();
DescribeSitesAsync(
request,
[prom](
const CdcClient*,
const DescribeSitesRequest&,
DescribeSitesOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::DescribeSitesDetailOutcome CdcClient::DescribeSitesDetail(const DescribeSitesDetailRequest &request)
{
auto outcome = MakeRequest(request, "DescribeSitesDetail");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DescribeSitesDetailResponse rsp = DescribeSitesDetailResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DescribeSitesDetailOutcome(rsp);
else
return DescribeSitesDetailOutcome(o.GetError());
}
else
{
return DescribeSitesDetailOutcome(outcome.GetError());
}
}
void CdcClient::DescribeSitesDetailAsync(const DescribeSitesDetailRequest& request, const DescribeSitesDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
using Req = const DescribeSitesDetailRequest&;
using Resp = DescribeSitesDetailResponse;
DoRequestAsync<Req, Resp>(
"DescribeSitesDetail", request, {{{"Content-Type", "application/json"}}},
[this, context, handler](Req req, Outcome<Core::Error, Resp> resp)
{
handler(this, req, std::move(resp), context);
});
}
CdcClient::DescribeSitesDetailOutcomeCallable CdcClient::DescribeSitesDetailCallable(const DescribeSitesDetailRequest &request)
{
const auto prom = std::make_shared<std::promise<DescribeSitesDetailOutcome>>();
DescribeSitesDetailAsync(
request,
[prom](
const CdcClient*,
const DescribeSitesDetailRequest&,
DescribeSitesDetailOutcome resp,
const std::shared_ptr<const AsyncCallerContext>&
)
{
prom->set_value(resp);
});
return prom->get_future();
}
CdcClient::ModifyDedicatedClusterInfoOutcome CdcClient::ModifyDedicatedClusterInfo(const ModifyDedicatedClusterInfoRequest &request)
{
auto outcome = MakeRequest(request, "ModifyDedicatedClusterInfo");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
ModifyDedicatedClusterInfoResponse rsp = ModifyDedicatedClusterInfoResponse();