/
ApigatewayClient.cpp
4170 lines (3683 loc) · 143 KB
/
ApigatewayClient.cpp
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-2019 THL A29 Limited, a Tencent company. 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/apigateway/v20180808/ApigatewayClient.h>
#include <tencentcloud/core/Executor.h>
#include <tencentcloud/core/Runnable.h>
using namespace TencentCloud;
using namespace TencentCloud::Apigateway::V20180808;
using namespace TencentCloud::Apigateway::V20180808::Model;
using namespace std;
namespace
{
const string VERSION = "2018-08-08";
const string ENDPOINT = "apigateway.tencentcloudapi.com";
}
ApigatewayClient::ApigatewayClient(const Credential &credential, const string ®ion) :
ApigatewayClient(credential, region, ClientProfile())
{
}
ApigatewayClient::ApigatewayClient(const Credential &credential, const string ®ion, const ClientProfile &profile) :
AbstractClient(ENDPOINT, VERSION, credential, region, profile)
{
}
ApigatewayClient::AttachPluginOutcome ApigatewayClient::AttachPlugin(const AttachPluginRequest &request)
{
auto outcome = MakeRequest(request, "AttachPlugin");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
AttachPluginResponse rsp = AttachPluginResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return AttachPluginOutcome(rsp);
else
return AttachPluginOutcome(o.GetError());
}
else
{
return AttachPluginOutcome(outcome.GetError());
}
}
void ApigatewayClient::AttachPluginAsync(const AttachPluginRequest& request, const AttachPluginAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->AttachPlugin(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::AttachPluginOutcomeCallable ApigatewayClient::AttachPluginCallable(const AttachPluginRequest &request)
{
auto task = std::make_shared<std::packaged_task<AttachPluginOutcome()>>(
[this, request]()
{
return this->AttachPlugin(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BindApiAppOutcome ApigatewayClient::BindApiApp(const BindApiAppRequest &request)
{
auto outcome = MakeRequest(request, "BindApiApp");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BindApiAppResponse rsp = BindApiAppResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BindApiAppOutcome(rsp);
else
return BindApiAppOutcome(o.GetError());
}
else
{
return BindApiAppOutcome(outcome.GetError());
}
}
void ApigatewayClient::BindApiAppAsync(const BindApiAppRequest& request, const BindApiAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BindApiApp(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BindApiAppOutcomeCallable ApigatewayClient::BindApiAppCallable(const BindApiAppRequest &request)
{
auto task = std::make_shared<std::packaged_task<BindApiAppOutcome()>>(
[this, request]()
{
return this->BindApiApp(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BindEnvironmentOutcome ApigatewayClient::BindEnvironment(const BindEnvironmentRequest &request)
{
auto outcome = MakeRequest(request, "BindEnvironment");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BindEnvironmentResponse rsp = BindEnvironmentResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BindEnvironmentOutcome(rsp);
else
return BindEnvironmentOutcome(o.GetError());
}
else
{
return BindEnvironmentOutcome(outcome.GetError());
}
}
void ApigatewayClient::BindEnvironmentAsync(const BindEnvironmentRequest& request, const BindEnvironmentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BindEnvironment(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BindEnvironmentOutcomeCallable ApigatewayClient::BindEnvironmentCallable(const BindEnvironmentRequest &request)
{
auto task = std::make_shared<std::packaged_task<BindEnvironmentOutcome()>>(
[this, request]()
{
return this->BindEnvironment(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BindIPStrategyOutcome ApigatewayClient::BindIPStrategy(const BindIPStrategyRequest &request)
{
auto outcome = MakeRequest(request, "BindIPStrategy");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BindIPStrategyResponse rsp = BindIPStrategyResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BindIPStrategyOutcome(rsp);
else
return BindIPStrategyOutcome(o.GetError());
}
else
{
return BindIPStrategyOutcome(outcome.GetError());
}
}
void ApigatewayClient::BindIPStrategyAsync(const BindIPStrategyRequest& request, const BindIPStrategyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BindIPStrategy(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BindIPStrategyOutcomeCallable ApigatewayClient::BindIPStrategyCallable(const BindIPStrategyRequest &request)
{
auto task = std::make_shared<std::packaged_task<BindIPStrategyOutcome()>>(
[this, request]()
{
return this->BindIPStrategy(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BindSecretIdsOutcome ApigatewayClient::BindSecretIds(const BindSecretIdsRequest &request)
{
auto outcome = MakeRequest(request, "BindSecretIds");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BindSecretIdsResponse rsp = BindSecretIdsResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BindSecretIdsOutcome(rsp);
else
return BindSecretIdsOutcome(o.GetError());
}
else
{
return BindSecretIdsOutcome(outcome.GetError());
}
}
void ApigatewayClient::BindSecretIdsAsync(const BindSecretIdsRequest& request, const BindSecretIdsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BindSecretIds(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BindSecretIdsOutcomeCallable ApigatewayClient::BindSecretIdsCallable(const BindSecretIdsRequest &request)
{
auto task = std::make_shared<std::packaged_task<BindSecretIdsOutcome()>>(
[this, request]()
{
return this->BindSecretIds(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BindSubDomainOutcome ApigatewayClient::BindSubDomain(const BindSubDomainRequest &request)
{
auto outcome = MakeRequest(request, "BindSubDomain");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BindSubDomainResponse rsp = BindSubDomainResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BindSubDomainOutcome(rsp);
else
return BindSubDomainOutcome(o.GetError());
}
else
{
return BindSubDomainOutcome(outcome.GetError());
}
}
void ApigatewayClient::BindSubDomainAsync(const BindSubDomainRequest& request, const BindSubDomainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BindSubDomain(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BindSubDomainOutcomeCallable ApigatewayClient::BindSubDomainCallable(const BindSubDomainRequest &request)
{
auto task = std::make_shared<std::packaged_task<BindSubDomainOutcome()>>(
[this, request]()
{
return this->BindSubDomain(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::BuildAPIDocOutcome ApigatewayClient::BuildAPIDoc(const BuildAPIDocRequest &request)
{
auto outcome = MakeRequest(request, "BuildAPIDoc");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
BuildAPIDocResponse rsp = BuildAPIDocResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return BuildAPIDocOutcome(rsp);
else
return BuildAPIDocOutcome(o.GetError());
}
else
{
return BuildAPIDocOutcome(outcome.GetError());
}
}
void ApigatewayClient::BuildAPIDocAsync(const BuildAPIDocRequest& request, const BuildAPIDocAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->BuildAPIDoc(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::BuildAPIDocOutcomeCallable ApigatewayClient::BuildAPIDocCallable(const BuildAPIDocRequest &request)
{
auto task = std::make_shared<std::packaged_task<BuildAPIDocOutcome()>>(
[this, request]()
{
return this->BuildAPIDoc(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateAPIDocOutcome ApigatewayClient::CreateAPIDoc(const CreateAPIDocRequest &request)
{
auto outcome = MakeRequest(request, "CreateAPIDoc");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateAPIDocResponse rsp = CreateAPIDocResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateAPIDocOutcome(rsp);
else
return CreateAPIDocOutcome(o.GetError());
}
else
{
return CreateAPIDocOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateAPIDocAsync(const CreateAPIDocRequest& request, const CreateAPIDocAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateAPIDoc(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateAPIDocOutcomeCallable ApigatewayClient::CreateAPIDocCallable(const CreateAPIDocRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateAPIDocOutcome()>>(
[this, request]()
{
return this->CreateAPIDoc(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateApiOutcome ApigatewayClient::CreateApi(const CreateApiRequest &request)
{
auto outcome = MakeRequest(request, "CreateApi");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateApiResponse rsp = CreateApiResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateApiOutcome(rsp);
else
return CreateApiOutcome(o.GetError());
}
else
{
return CreateApiOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateApiAsync(const CreateApiRequest& request, const CreateApiAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateApi(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateApiOutcomeCallable ApigatewayClient::CreateApiCallable(const CreateApiRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateApiOutcome()>>(
[this, request]()
{
return this->CreateApi(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateApiAppOutcome ApigatewayClient::CreateApiApp(const CreateApiAppRequest &request)
{
auto outcome = MakeRequest(request, "CreateApiApp");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateApiAppResponse rsp = CreateApiAppResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateApiAppOutcome(rsp);
else
return CreateApiAppOutcome(o.GetError());
}
else
{
return CreateApiAppOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateApiAppAsync(const CreateApiAppRequest& request, const CreateApiAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateApiApp(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateApiAppOutcomeCallable ApigatewayClient::CreateApiAppCallable(const CreateApiAppRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateApiAppOutcome()>>(
[this, request]()
{
return this->CreateApiApp(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateApiKeyOutcome ApigatewayClient::CreateApiKey(const CreateApiKeyRequest &request)
{
auto outcome = MakeRequest(request, "CreateApiKey");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateApiKeyResponse rsp = CreateApiKeyResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateApiKeyOutcome(rsp);
else
return CreateApiKeyOutcome(o.GetError());
}
else
{
return CreateApiKeyOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateApiKeyAsync(const CreateApiKeyRequest& request, const CreateApiKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateApiKey(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateApiKeyOutcomeCallable ApigatewayClient::CreateApiKeyCallable(const CreateApiKeyRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateApiKeyOutcome()>>(
[this, request]()
{
return this->CreateApiKey(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateIPStrategyOutcome ApigatewayClient::CreateIPStrategy(const CreateIPStrategyRequest &request)
{
auto outcome = MakeRequest(request, "CreateIPStrategy");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateIPStrategyResponse rsp = CreateIPStrategyResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateIPStrategyOutcome(rsp);
else
return CreateIPStrategyOutcome(o.GetError());
}
else
{
return CreateIPStrategyOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateIPStrategyAsync(const CreateIPStrategyRequest& request, const CreateIPStrategyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateIPStrategy(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateIPStrategyOutcomeCallable ApigatewayClient::CreateIPStrategyCallable(const CreateIPStrategyRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateIPStrategyOutcome()>>(
[this, request]()
{
return this->CreateIPStrategy(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreatePluginOutcome ApigatewayClient::CreatePlugin(const CreatePluginRequest &request)
{
auto outcome = MakeRequest(request, "CreatePlugin");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreatePluginResponse rsp = CreatePluginResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreatePluginOutcome(rsp);
else
return CreatePluginOutcome(o.GetError());
}
else
{
return CreatePluginOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreatePluginAsync(const CreatePluginRequest& request, const CreatePluginAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreatePlugin(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreatePluginOutcomeCallable ApigatewayClient::CreatePluginCallable(const CreatePluginRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreatePluginOutcome()>>(
[this, request]()
{
return this->CreatePlugin(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateServiceOutcome ApigatewayClient::CreateService(const CreateServiceRequest &request)
{
auto outcome = MakeRequest(request, "CreateService");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateServiceResponse rsp = CreateServiceResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateServiceOutcome(rsp);
else
return CreateServiceOutcome(o.GetError());
}
else
{
return CreateServiceOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateServiceAsync(const CreateServiceRequest& request, const CreateServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateService(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateServiceOutcomeCallable ApigatewayClient::CreateServiceCallable(const CreateServiceRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateServiceOutcome()>>(
[this, request]()
{
return this->CreateService(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateUpstreamOutcome ApigatewayClient::CreateUpstream(const CreateUpstreamRequest &request)
{
auto outcome = MakeRequest(request, "CreateUpstream");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateUpstreamResponse rsp = CreateUpstreamResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateUpstreamOutcome(rsp);
else
return CreateUpstreamOutcome(o.GetError());
}
else
{
return CreateUpstreamOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateUpstreamAsync(const CreateUpstreamRequest& request, const CreateUpstreamAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateUpstream(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateUpstreamOutcomeCallable ApigatewayClient::CreateUpstreamCallable(const CreateUpstreamRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateUpstreamOutcome()>>(
[this, request]()
{
return this->CreateUpstream(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::CreateUsagePlanOutcome ApigatewayClient::CreateUsagePlan(const CreateUsagePlanRequest &request)
{
auto outcome = MakeRequest(request, "CreateUsagePlan");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
CreateUsagePlanResponse rsp = CreateUsagePlanResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return CreateUsagePlanOutcome(rsp);
else
return CreateUsagePlanOutcome(o.GetError());
}
else
{
return CreateUsagePlanOutcome(outcome.GetError());
}
}
void ApigatewayClient::CreateUsagePlanAsync(const CreateUsagePlanRequest& request, const CreateUsagePlanAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->CreateUsagePlan(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::CreateUsagePlanOutcomeCallable ApigatewayClient::CreateUsagePlanCallable(const CreateUsagePlanRequest &request)
{
auto task = std::make_shared<std::packaged_task<CreateUsagePlanOutcome()>>(
[this, request]()
{
return this->CreateUsagePlan(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteAPIDocOutcome ApigatewayClient::DeleteAPIDoc(const DeleteAPIDocRequest &request)
{
auto outcome = MakeRequest(request, "DeleteAPIDoc");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteAPIDocResponse rsp = DeleteAPIDocResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteAPIDocOutcome(rsp);
else
return DeleteAPIDocOutcome(o.GetError());
}
else
{
return DeleteAPIDocOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeleteAPIDocAsync(const DeleteAPIDocRequest& request, const DeleteAPIDocAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeleteAPIDoc(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeleteAPIDocOutcomeCallable ApigatewayClient::DeleteAPIDocCallable(const DeleteAPIDocRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeleteAPIDocOutcome()>>(
[this, request]()
{
return this->DeleteAPIDoc(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteApiOutcome ApigatewayClient::DeleteApi(const DeleteApiRequest &request)
{
auto outcome = MakeRequest(request, "DeleteApi");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteApiResponse rsp = DeleteApiResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteApiOutcome(rsp);
else
return DeleteApiOutcome(o.GetError());
}
else
{
return DeleteApiOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeleteApiAsync(const DeleteApiRequest& request, const DeleteApiAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeleteApi(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeleteApiOutcomeCallable ApigatewayClient::DeleteApiCallable(const DeleteApiRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeleteApiOutcome()>>(
[this, request]()
{
return this->DeleteApi(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteApiAppOutcome ApigatewayClient::DeleteApiApp(const DeleteApiAppRequest &request)
{
auto outcome = MakeRequest(request, "DeleteApiApp");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteApiAppResponse rsp = DeleteApiAppResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteApiAppOutcome(rsp);
else
return DeleteApiAppOutcome(o.GetError());
}
else
{
return DeleteApiAppOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeleteApiAppAsync(const DeleteApiAppRequest& request, const DeleteApiAppAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeleteApiApp(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeleteApiAppOutcomeCallable ApigatewayClient::DeleteApiAppCallable(const DeleteApiAppRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeleteApiAppOutcome()>>(
[this, request]()
{
return this->DeleteApiApp(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteApiKeyOutcome ApigatewayClient::DeleteApiKey(const DeleteApiKeyRequest &request)
{
auto outcome = MakeRequest(request, "DeleteApiKey");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteApiKeyResponse rsp = DeleteApiKeyResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteApiKeyOutcome(rsp);
else
return DeleteApiKeyOutcome(o.GetError());
}
else
{
return DeleteApiKeyOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeleteApiKeyAsync(const DeleteApiKeyRequest& request, const DeleteApiKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeleteApiKey(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeleteApiKeyOutcomeCallable ApigatewayClient::DeleteApiKeyCallable(const DeleteApiKeyRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeleteApiKeyOutcome()>>(
[this, request]()
{
return this->DeleteApiKey(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteIPStrategyOutcome ApigatewayClient::DeleteIPStrategy(const DeleteIPStrategyRequest &request)
{
auto outcome = MakeRequest(request, "DeleteIPStrategy");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteIPStrategyResponse rsp = DeleteIPStrategyResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteIPStrategyOutcome(rsp);
else
return DeleteIPStrategyOutcome(o.GetError());
}
else
{
return DeleteIPStrategyOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeleteIPStrategyAsync(const DeleteIPStrategyRequest& request, const DeleteIPStrategyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeleteIPStrategy(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeleteIPStrategyOutcomeCallable ApigatewayClient::DeleteIPStrategyCallable(const DeleteIPStrategyRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeleteIPStrategyOutcome()>>(
[this, request]()
{
return this->DeleteIPStrategy(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeletePluginOutcome ApigatewayClient::DeletePlugin(const DeletePluginRequest &request)
{
auto outcome = MakeRequest(request, "DeletePlugin");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeletePluginResponse rsp = DeletePluginResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeletePluginOutcome(rsp);
else
return DeletePluginOutcome(o.GetError());
}
else
{
return DeletePluginOutcome(outcome.GetError());
}
}
void ApigatewayClient::DeletePluginAsync(const DeletePluginRequest& request, const DeletePluginAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context)
{
auto fn = [this, request, handler, context]()
{
handler(this, request, this->DeletePlugin(request), context);
};
Executor::GetInstance()->Submit(new Runnable(fn));
}
ApigatewayClient::DeletePluginOutcomeCallable ApigatewayClient::DeletePluginCallable(const DeletePluginRequest &request)
{
auto task = std::make_shared<std::packaged_task<DeletePluginOutcome()>>(
[this, request]()
{
return this->DeletePlugin(request);
}
);
Executor::GetInstance()->Submit(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ApigatewayClient::DeleteServiceOutcome ApigatewayClient::DeleteService(const DeleteServiceRequest &request)
{
auto outcome = MakeRequest(request, "DeleteService");
if (outcome.IsSuccess())
{
auto r = outcome.GetResult();
string payload = string(r.Body(), r.BodySize());
DeleteServiceResponse rsp = DeleteServiceResponse();
auto o = rsp.Deserialize(payload);
if (o.IsSuccess())
return DeleteServiceOutcome(rsp);
else