forked from aws/aws-sdk-go-v2
/
api.go
2968 lines (2408 loc) · 84.8 KB
/
api.go
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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package xray
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
const opBatchGetTraces = "BatchGetTraces"
// BatchGetTracesRequest is a API request type for the BatchGetTraces API operation.
type BatchGetTracesRequest struct {
*aws.Request
Input *BatchGetTracesInput
Copy func(*BatchGetTracesInput) BatchGetTracesRequest
}
// Send marshals and sends the BatchGetTraces API request.
func (r BatchGetTracesRequest) Send() (*BatchGetTracesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*BatchGetTracesOutput), nil
}
// BatchGetTracesRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Retrieves a list of traces specified by ID. Each trace is a collection of
// segment documents that originates from a single request. Use GetTraceSummaries
// to get a list of trace IDs.
//
// // Example sending a request using the BatchGetTracesRequest method.
// req := client.BatchGetTracesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces
func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) BatchGetTracesRequest {
op := &aws.Operation{
Name: opBatchGetTraces,
HTTPMethod: "POST",
HTTPPath: "/Traces",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &BatchGetTracesInput{}
}
output := &BatchGetTracesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return BatchGetTracesRequest{Request: req, Input: input, Copy: c.BatchGetTracesRequest}
}
// Paginate pages iterates over the pages of a BatchGetTracesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a BatchGetTraces operation.
// req := client.BatchGetTracesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *BatchGetTracesRequest) Paginate(opts ...aws.Option) BatchGetTracesPager {
return BatchGetTracesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *BatchGetTracesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// BatchGetTracesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type BatchGetTracesPager struct {
aws.Pager
}
func (p *BatchGetTracesPager) CurrentPage() *BatchGetTracesOutput {
return p.Pager.CurrentPage().(*BatchGetTracesOutput)
}
const opGetEncryptionConfig = "GetEncryptionConfig"
// GetEncryptionConfigRequest is a API request type for the GetEncryptionConfig API operation.
type GetEncryptionConfigRequest struct {
*aws.Request
Input *GetEncryptionConfigInput
Copy func(*GetEncryptionConfigInput) GetEncryptionConfigRequest
}
// Send marshals and sends the GetEncryptionConfig API request.
func (r GetEncryptionConfigRequest) Send() (*GetEncryptionConfigOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetEncryptionConfigOutput), nil
}
// GetEncryptionConfigRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Retrieves the current encryption configuration for X-Ray data.
//
// // Example sending a request using the GetEncryptionConfigRequest method.
// req := client.GetEncryptionConfigRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig
func (c *XRay) GetEncryptionConfigRequest(input *GetEncryptionConfigInput) GetEncryptionConfigRequest {
op := &aws.Operation{
Name: opGetEncryptionConfig,
HTTPMethod: "POST",
HTTPPath: "/EncryptionConfig",
}
if input == nil {
input = &GetEncryptionConfigInput{}
}
output := &GetEncryptionConfigOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetEncryptionConfigRequest{Request: req, Input: input, Copy: c.GetEncryptionConfigRequest}
}
const opGetServiceGraph = "GetServiceGraph"
// GetServiceGraphRequest is a API request type for the GetServiceGraph API operation.
type GetServiceGraphRequest struct {
*aws.Request
Input *GetServiceGraphInput
Copy func(*GetServiceGraphInput) GetServiceGraphRequest
}
// Send marshals and sends the GetServiceGraph API request.
func (r GetServiceGraphRequest) Send() (*GetServiceGraphOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetServiceGraphOutput), nil
}
// GetServiceGraphRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Retrieves a document that describes services that process incoming requests,
// and downstream services that they call as a result. Root services process
// incoming requests and make calls to downstream services. Root services are
// applications that use the AWS X-Ray SDK. Downstream services can be other
// applications, AWS resources, HTTP web APIs, or SQL databases.
//
// // Example sending a request using the GetServiceGraphRequest method.
// req := client.GetServiceGraphRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph
func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) GetServiceGraphRequest {
op := &aws.Operation{
Name: opGetServiceGraph,
HTTPMethod: "POST",
HTTPPath: "/ServiceGraph",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &GetServiceGraphInput{}
}
output := &GetServiceGraphOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetServiceGraphRequest{Request: req, Input: input, Copy: c.GetServiceGraphRequest}
}
// Paginate pages iterates over the pages of a GetServiceGraphRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetServiceGraph operation.
// req := client.GetServiceGraphRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *GetServiceGraphRequest) Paginate(opts ...aws.Option) GetServiceGraphPager {
return GetServiceGraphPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *GetServiceGraphInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// GetServiceGraphPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type GetServiceGraphPager struct {
aws.Pager
}
func (p *GetServiceGraphPager) CurrentPage() *GetServiceGraphOutput {
return p.Pager.CurrentPage().(*GetServiceGraphOutput)
}
const opGetTraceGraph = "GetTraceGraph"
// GetTraceGraphRequest is a API request type for the GetTraceGraph API operation.
type GetTraceGraphRequest struct {
*aws.Request
Input *GetTraceGraphInput
Copy func(*GetTraceGraphInput) GetTraceGraphRequest
}
// Send marshals and sends the GetTraceGraph API request.
func (r GetTraceGraphRequest) Send() (*GetTraceGraphOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetTraceGraphOutput), nil
}
// GetTraceGraphRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Retrieves a service graph for one or more specific trace IDs.
//
// // Example sending a request using the GetTraceGraphRequest method.
// req := client.GetTraceGraphRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph
func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) GetTraceGraphRequest {
op := &aws.Operation{
Name: opGetTraceGraph,
HTTPMethod: "POST",
HTTPPath: "/TraceGraph",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &GetTraceGraphInput{}
}
output := &GetTraceGraphOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetTraceGraphRequest{Request: req, Input: input, Copy: c.GetTraceGraphRequest}
}
// Paginate pages iterates over the pages of a GetTraceGraphRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetTraceGraph operation.
// req := client.GetTraceGraphRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *GetTraceGraphRequest) Paginate(opts ...aws.Option) GetTraceGraphPager {
return GetTraceGraphPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *GetTraceGraphInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// GetTraceGraphPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type GetTraceGraphPager struct {
aws.Pager
}
func (p *GetTraceGraphPager) CurrentPage() *GetTraceGraphOutput {
return p.Pager.CurrentPage().(*GetTraceGraphOutput)
}
const opGetTraceSummaries = "GetTraceSummaries"
// GetTraceSummariesRequest is a API request type for the GetTraceSummaries API operation.
type GetTraceSummariesRequest struct {
*aws.Request
Input *GetTraceSummariesInput
Copy func(*GetTraceSummariesInput) GetTraceSummariesRequest
}
// Send marshals and sends the GetTraceSummaries API request.
func (r GetTraceSummariesRequest) Send() (*GetTraceSummariesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetTraceSummariesOutput), nil
}
// GetTraceSummariesRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Retrieves IDs and metadata for traces available for a specified time frame
// using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces.
//
// A filter expression can target traced requests that hit specific service
// nodes or edges, have errors, or come from a known user. For example, the
// following filter expression targets traces that pass through api.example.com:
//
// service("api.example.com")
//
// This filter expression finds traces that have an annotation named account
// with the value 12345:
//
// annotation.account = "12345"
//
// For a full list of indexed fields and keywords that you can use in filter
// expressions, see Using Filter Expressions (http://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html)
// in the AWS X-Ray Developer Guide.
//
// // Example sending a request using the GetTraceSummariesRequest method.
// req := client.GetTraceSummariesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries
func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) GetTraceSummariesRequest {
op := &aws.Operation{
Name: opGetTraceSummaries,
HTTPMethod: "POST",
HTTPPath: "/TraceSummaries",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &GetTraceSummariesInput{}
}
output := &GetTraceSummariesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetTraceSummariesRequest{Request: req, Input: input, Copy: c.GetTraceSummariesRequest}
}
// Paginate pages iterates over the pages of a GetTraceSummariesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a GetTraceSummaries operation.
// req := client.GetTraceSummariesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *GetTraceSummariesRequest) Paginate(opts ...aws.Option) GetTraceSummariesPager {
return GetTraceSummariesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *GetTraceSummariesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// GetTraceSummariesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type GetTraceSummariesPager struct {
aws.Pager
}
func (p *GetTraceSummariesPager) CurrentPage() *GetTraceSummariesOutput {
return p.Pager.CurrentPage().(*GetTraceSummariesOutput)
}
const opPutEncryptionConfig = "PutEncryptionConfig"
// PutEncryptionConfigRequest is a API request type for the PutEncryptionConfig API operation.
type PutEncryptionConfigRequest struct {
*aws.Request
Input *PutEncryptionConfigInput
Copy func(*PutEncryptionConfigInput) PutEncryptionConfigRequest
}
// Send marshals and sends the PutEncryptionConfig API request.
func (r PutEncryptionConfigRequest) Send() (*PutEncryptionConfigOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*PutEncryptionConfigOutput), nil
}
// PutEncryptionConfigRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Updates the encryption configuration for X-Ray data.
//
// // Example sending a request using the PutEncryptionConfigRequest method.
// req := client.PutEncryptionConfigRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig
func (c *XRay) PutEncryptionConfigRequest(input *PutEncryptionConfigInput) PutEncryptionConfigRequest {
op := &aws.Operation{
Name: opPutEncryptionConfig,
HTTPMethod: "POST",
HTTPPath: "/PutEncryptionConfig",
}
if input == nil {
input = &PutEncryptionConfigInput{}
}
output := &PutEncryptionConfigOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return PutEncryptionConfigRequest{Request: req, Input: input, Copy: c.PutEncryptionConfigRequest}
}
const opPutTelemetryRecords = "PutTelemetryRecords"
// PutTelemetryRecordsRequest is a API request type for the PutTelemetryRecords API operation.
type PutTelemetryRecordsRequest struct {
*aws.Request
Input *PutTelemetryRecordsInput
Copy func(*PutTelemetryRecordsInput) PutTelemetryRecordsRequest
}
// Send marshals and sends the PutTelemetryRecords API request.
func (r PutTelemetryRecordsRequest) Send() (*PutTelemetryRecordsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*PutTelemetryRecordsOutput), nil
}
// PutTelemetryRecordsRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Used by the AWS X-Ray daemon to upload telemetry.
//
// // Example sending a request using the PutTelemetryRecordsRequest method.
// req := client.PutTelemetryRecordsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords
func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) PutTelemetryRecordsRequest {
op := &aws.Operation{
Name: opPutTelemetryRecords,
HTTPMethod: "POST",
HTTPPath: "/TelemetryRecords",
}
if input == nil {
input = &PutTelemetryRecordsInput{}
}
output := &PutTelemetryRecordsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return PutTelemetryRecordsRequest{Request: req, Input: input, Copy: c.PutTelemetryRecordsRequest}
}
const opPutTraceSegments = "PutTraceSegments"
// PutTraceSegmentsRequest is a API request type for the PutTraceSegments API operation.
type PutTraceSegmentsRequest struct {
*aws.Request
Input *PutTraceSegmentsInput
Copy func(*PutTraceSegmentsInput) PutTraceSegmentsRequest
}
// Send marshals and sends the PutTraceSegments API request.
func (r PutTraceSegmentsRequest) Send() (*PutTraceSegmentsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*PutTraceSegmentsOutput), nil
}
// PutTraceSegmentsRequest returns a request value for making API operation for
// AWS X-Ray.
//
// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents
// and sends them to the X-Ray daemon, which uploads them in batches. A segment
// document can be a completed segment, an in-progress segment, or an array
// of subsegments.
//
// Segments must include the following fields. For the full segment document
// schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html)
// in the AWS X-Ray Developer Guide.
//
// Required Segment Document Fields
//
// * name - The name of the service that handled the request.
//
// * id - A 64-bit identifier for the segment, unique among segments in the
// same trace, in 16 hexadecimal digits.
//
// * trace_id - A unique identifier that connects all segments and subsegments
// originating from a single client request.
//
// * start_time - Time the segment or subsegment was created, in floating
// point seconds in epoch time, accurate to milliseconds. For example, 1480615200.010
// or 1.480615200010E9.
//
// * end_time - Time the segment or subsegment was closed. For example, 1480615200.090
// or 1.480615200090E9. Specify either an end_time or in_progress.
//
// * in_progress - Set to true instead of specifying an end_time to record
// that a segment has been started, but is not complete. Send an in progress
// segment when your application receives a request that will take a long
// time to serve, to trace the fact that the request was received. When the
// response is sent, send the complete segment to overwrite the in-progress
// segment.
//
// A trace_id consists of three numbers separated by hyphens. For example, 1-58406520-a006649127e371903a2de979.
// This includes:
//
// Trace ID Format
//
// * The version number, i.e. 1.
//
// * The time of the original request, in Unix epoch time, in 8 hexadecimal
// digits. For example, 10:00AM December 2nd, 2016 PST in epoch time is 1480615200
// seconds, or 58406520 in hexadecimal.
//
// * A 96-bit identifier for the trace, globally unique, in 24 hexadecimal
// digits.
//
// // Example sending a request using the PutTraceSegmentsRequest method.
// req := client.PutTraceSegmentsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments
func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) PutTraceSegmentsRequest {
op := &aws.Operation{
Name: opPutTraceSegments,
HTTPMethod: "POST",
HTTPPath: "/TraceSegments",
}
if input == nil {
input = &PutTraceSegmentsInput{}
}
output := &PutTraceSegmentsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return PutTraceSegmentsRequest{Request: req, Input: input, Copy: c.PutTraceSegmentsRequest}
}
// An alias for an edge.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/Alias
type Alias struct {
_ struct{} `type:"structure"`
// The canonical name of the alias.
Name *string `type:"string"`
// A list of names for the alias, including the canonical name.
Names []string `type:"list"`
// The type of the alias.
Type *string `type:"string"`
}
// String returns the string representation
func (s Alias) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Alias) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Alias) MarshalFields(e protocol.FieldEncoder) error {
if s.Name != nil {
v := *s.Name
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "Name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.Names) > 0 {
v := s.Names
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "Names", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ls0.End()
}
if s.Type != nil {
v := *s.Type
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "Type", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Value of a segment annotation. Has one of three value types: Number, Boolean
// or String.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/AnnotationValue
type AnnotationValue struct {
_ struct{} `type:"structure"`
// Value for a Boolean annotation.
BooleanValue *bool `type:"boolean"`
// Value for a Number annotation.
NumberValue *float64 `type:"double"`
// Value for a String annotation.
StringValue *string `type:"string"`
}
// String returns the string representation
func (s AnnotationValue) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AnnotationValue) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AnnotationValue) MarshalFields(e protocol.FieldEncoder) error {
if s.BooleanValue != nil {
v := *s.BooleanValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "BooleanValue", protocol.BoolValue(v), metadata)
}
if s.NumberValue != nil {
v := *s.NumberValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "NumberValue", protocol.Float64Value(v), metadata)
}
if s.StringValue != nil {
v := *s.StringValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "StringValue", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BackendConnectionErrors
type BackendConnectionErrors struct {
_ struct{} `type:"structure"`
ConnectionRefusedCount *int64 `type:"integer"`
HTTPCode4XXCount *int64 `type:"integer"`
HTTPCode5XXCount *int64 `type:"integer"`
OtherCount *int64 `type:"integer"`
TimeoutCount *int64 `type:"integer"`
UnknownHostCount *int64 `type:"integer"`
}
// String returns the string representation
func (s BackendConnectionErrors) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BackendConnectionErrors) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s BackendConnectionErrors) MarshalFields(e protocol.FieldEncoder) error {
if s.ConnectionRefusedCount != nil {
v := *s.ConnectionRefusedCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "ConnectionRefusedCount", protocol.Int64Value(v), metadata)
}
if s.HTTPCode4XXCount != nil {
v := *s.HTTPCode4XXCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "HTTPCode4XXCount", protocol.Int64Value(v), metadata)
}
if s.HTTPCode5XXCount != nil {
v := *s.HTTPCode5XXCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "HTTPCode5XXCount", protocol.Int64Value(v), metadata)
}
if s.OtherCount != nil {
v := *s.OtherCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "OtherCount", protocol.Int64Value(v), metadata)
}
if s.TimeoutCount != nil {
v := *s.TimeoutCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "TimeoutCount", protocol.Int64Value(v), metadata)
}
if s.UnknownHostCount != nil {
v := *s.UnknownHostCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "UnknownHostCount", protocol.Int64Value(v), metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTracesRequest
type BatchGetTracesInput struct {
_ struct{} `type:"structure"`
// Pagination token. Not used.
NextToken *string `type:"string"`
// Specify the trace IDs of requests for which to retrieve segments.
//
// TraceIds is a required field
TraceIds []string `type:"list" required:"true"`
}
// String returns the string representation
func (s BatchGetTracesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchGetTracesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetTracesInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "BatchGetTracesInput"}
if s.TraceIds == nil {
invalidParams.Add(aws.NewErrParamRequired("TraceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s BatchGetTracesInput) MarshalFields(e protocol.FieldEncoder) error {
if s.NextToken != nil {
v := *s.NextToken
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "NextToken", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.TraceIds) > 0 {
v := s.TraceIds
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "TraceIds", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ls0.End()
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTracesResult
type BatchGetTracesOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// Pagination token. Not used.
NextToken *string `type:"string"`
// Full traces for the specified requests.
Traces []Trace `type:"list"`
// Trace IDs of requests that haven't been processed.
UnprocessedTraceIds []string `type:"list"`
}
// String returns the string representation
func (s BatchGetTracesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s BatchGetTracesOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s BatchGetTracesOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s BatchGetTracesOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.NextToken != nil {
v := *s.NextToken
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "NextToken", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.Traces) > 0 {
v := s.Traces
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "Traces", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if len(s.UnprocessedTraceIds) > 0 {
v := s.UnprocessedTraceIds
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "UnprocessedTraceIds", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ls0.End()
}
return nil
}
// Information about a connection between two services.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/Edge
type Edge struct {
_ struct{} `type:"structure"`
// Aliases for the edge.
Aliases []Alias `type:"list"`
// The end time of the last segment on the edge.
EndTime *time.Time `type:"timestamp" timestampFormat:"unix"`
// Identifier of the edge. Unique within a service map.
ReferenceId *int64 `type:"integer"`