-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
api.go
814 lines (694 loc) · 25.2 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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudtraildata
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
)
const opPutAuditEvents = "PutAuditEvents"
// PutAuditEventsRequest generates a "aws/request.Request" representing the
// client's request for the PutAuditEvents operation. The "output" return
// value will be populated with the request's response once the request completes
// successfully.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See PutAuditEvents for more information on using the PutAuditEvents
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
// // Example sending a request using the PutAuditEventsRequest method.
// req, resp := client.PutAuditEventsRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents
func (c *CloudTrailData) PutAuditEventsRequest(input *PutAuditEventsInput) (req *request.Request, output *PutAuditEventsOutput) {
op := &request.Operation{
Name: opPutAuditEvents,
HTTPMethod: "POST",
HTTPPath: "/PutAuditEvents",
}
if input == nil {
input = &PutAuditEventsInput{}
}
output = &PutAuditEventsOutput{}
req = c.newRequest(op, input, output)
return
}
// PutAuditEvents API operation for AWS CloudTrail Data Service.
//
// Ingests your application events into CloudTrail Lake. A required parameter,
// auditEvents, accepts the JSON records (also called payload) of events that
// you want CloudTrail to ingest. You can add up to 100 of these events (or
// up to 1 MB) per PutAuditEvents request.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS CloudTrail Data Service's
// API operation PutAuditEvents for usage and error information.
//
// Returned Error Types:
//
// - ChannelInsufficientPermission
// The caller's account ID must be the same as the channel owner's account ID.
//
// - ChannelNotFound
// The channel could not be found.
//
// - InvalidChannelARN
// The specified channel ARN is not a valid channel ARN.
//
// - ChannelUnsupportedSchema
// The schema type of the event is not supported.
//
// - DuplicatedAuditEventId
// Two or more entries in the request have the same event ID.
//
// - UnsupportedOperationException
// The operation requested is not supported in this region or account.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents
func (c *CloudTrailData) PutAuditEvents(input *PutAuditEventsInput) (*PutAuditEventsOutput, error) {
req, out := c.PutAuditEventsRequest(input)
return out, req.Send()
}
// PutAuditEventsWithContext is the same as PutAuditEvents with the addition of
// the ability to pass a context and additional request options.
//
// See PutAuditEvents for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudTrailData) PutAuditEventsWithContext(ctx aws.Context, input *PutAuditEventsInput, opts ...request.Option) (*PutAuditEventsOutput, error) {
req, out := c.PutAuditEventsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
// An event from a source outside of Amazon Web Services that you want CloudTrail
// to log.
type AuditEvent struct {
_ struct{} `type:"structure"`
// The content of an audit event that comes from the event, such as userIdentity,
// userAgent, and eventSource.
//
// EventData is a required field
EventData *string `locationName:"eventData" type:"string" required:"true"`
// A checksum is a base64-SHA256 algorithm that helps you verify that CloudTrail
// receives the event that matches with the checksum. Calculate the checksum
// by running a command like the following:
//
// printf %s $eventdata | openssl dgst -binary -sha256 | base64
EventDataChecksum *string `locationName:"eventDataChecksum" type:"string"`
// The original event ID from the source event.
//
// Id is a required field
Id *string `locationName:"id" min:"1" type:"string" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s AuditEvent) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s AuditEvent) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AuditEvent) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AuditEvent"}
if s.EventData == nil {
invalidParams.Add(request.NewErrParamRequired("EventData"))
}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.Id != nil && len(*s.Id) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Id", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetEventData sets the EventData field's value.
func (s *AuditEvent) SetEventData(v string) *AuditEvent {
s.EventData = &v
return s
}
// SetEventDataChecksum sets the EventDataChecksum field's value.
func (s *AuditEvent) SetEventDataChecksum(v string) *AuditEvent {
s.EventDataChecksum = &v
return s
}
// SetId sets the Id field's value.
func (s *AuditEvent) SetId(v string) *AuditEvent {
s.Id = &v
return s
}
// A response that includes successful and failed event results.
type AuditEventResultEntry struct {
_ struct{} `type:"structure"`
// The event ID assigned by CloudTrail.
//
// EventID is a required field
EventID *string `locationName:"eventID" min:"1" type:"string" required:"true"`
// The original event ID from the source event.
//
// Id is a required field
Id *string `locationName:"id" min:"1" type:"string" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s AuditEventResultEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s AuditEventResultEntry) GoString() string {
return s.String()
}
// SetEventID sets the EventID field's value.
func (s *AuditEventResultEntry) SetEventID(v string) *AuditEventResultEntry {
s.EventID = &v
return s
}
// SetId sets the Id field's value.
func (s *AuditEventResultEntry) SetId(v string) *AuditEventResultEntry {
s.Id = &v
return s
}
// The caller's account ID must be the same as the channel owner's account ID.
type ChannelInsufficientPermission struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelInsufficientPermission) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelInsufficientPermission) GoString() string {
return s.String()
}
func newErrorChannelInsufficientPermission(v protocol.ResponseMetadata) error {
return &ChannelInsufficientPermission{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *ChannelInsufficientPermission) Code() string {
return "ChannelInsufficientPermission"
}
// Message returns the exception's message.
func (s *ChannelInsufficientPermission) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *ChannelInsufficientPermission) OrigErr() error {
return nil
}
func (s *ChannelInsufficientPermission) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *ChannelInsufficientPermission) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *ChannelInsufficientPermission) RequestID() string {
return s.RespMetadata.RequestID
}
// The channel could not be found.
type ChannelNotFound struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelNotFound) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelNotFound) GoString() string {
return s.String()
}
func newErrorChannelNotFound(v protocol.ResponseMetadata) error {
return &ChannelNotFound{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *ChannelNotFound) Code() string {
return "ChannelNotFound"
}
// Message returns the exception's message.
func (s *ChannelNotFound) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *ChannelNotFound) OrigErr() error {
return nil
}
func (s *ChannelNotFound) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *ChannelNotFound) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *ChannelNotFound) RequestID() string {
return s.RespMetadata.RequestID
}
// The schema type of the event is not supported.
type ChannelUnsupportedSchema struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelUnsupportedSchema) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ChannelUnsupportedSchema) GoString() string {
return s.String()
}
func newErrorChannelUnsupportedSchema(v protocol.ResponseMetadata) error {
return &ChannelUnsupportedSchema{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *ChannelUnsupportedSchema) Code() string {
return "ChannelUnsupportedSchema"
}
// Message returns the exception's message.
func (s *ChannelUnsupportedSchema) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *ChannelUnsupportedSchema) OrigErr() error {
return nil
}
func (s *ChannelUnsupportedSchema) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *ChannelUnsupportedSchema) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *ChannelUnsupportedSchema) RequestID() string {
return s.RespMetadata.RequestID
}
// Two or more entries in the request have the same event ID.
type DuplicatedAuditEventId struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s DuplicatedAuditEventId) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s DuplicatedAuditEventId) GoString() string {
return s.String()
}
func newErrorDuplicatedAuditEventId(v protocol.ResponseMetadata) error {
return &DuplicatedAuditEventId{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *DuplicatedAuditEventId) Code() string {
return "DuplicatedAuditEventId"
}
// Message returns the exception's message.
func (s *DuplicatedAuditEventId) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *DuplicatedAuditEventId) OrigErr() error {
return nil
}
func (s *DuplicatedAuditEventId) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *DuplicatedAuditEventId) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *DuplicatedAuditEventId) RequestID() string {
return s.RespMetadata.RequestID
}
// The specified channel ARN is not a valid channel ARN.
type InvalidChannelARN struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s InvalidChannelARN) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s InvalidChannelARN) GoString() string {
return s.String()
}
func newErrorInvalidChannelARN(v protocol.ResponseMetadata) error {
return &InvalidChannelARN{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *InvalidChannelARN) Code() string {
return "InvalidChannelARN"
}
// Message returns the exception's message.
func (s *InvalidChannelARN) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *InvalidChannelARN) OrigErr() error {
return nil
}
func (s *InvalidChannelARN) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *InvalidChannelARN) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *InvalidChannelARN) RequestID() string {
return s.RespMetadata.RequestID
}
type PutAuditEventsInput struct {
_ struct{} `type:"structure"`
// The JSON payload of events that you want to ingest. You can also point to
// the JSON event payload in a file.
//
// AuditEvents is a required field
AuditEvents []*AuditEvent `locationName:"auditEvents" min:"1" type:"list" required:"true"`
// The ARN or ID (the ARN suffix) of a channel.
//
// ChannelArn is a required field
ChannelArn *string `location:"querystring" locationName:"channelArn" type:"string" required:"true"`
// A unique identifier that is conditionally required when the channel's resource
// policy includes an external ID. This value can be any string, such as a passphrase
// or account number.
ExternalId *string `location:"querystring" locationName:"externalId" min:"2" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s PutAuditEventsInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s PutAuditEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutAuditEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutAuditEventsInput"}
if s.AuditEvents == nil {
invalidParams.Add(request.NewErrParamRequired("AuditEvents"))
}
if s.AuditEvents != nil && len(s.AuditEvents) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AuditEvents", 1))
}
if s.ChannelArn == nil {
invalidParams.Add(request.NewErrParamRequired("ChannelArn"))
}
if s.ExternalId != nil && len(*s.ExternalId) < 2 {
invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2))
}
if s.AuditEvents != nil {
for i, v := range s.AuditEvents {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AuditEvents", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// SetAuditEvents sets the AuditEvents field's value.
func (s *PutAuditEventsInput) SetAuditEvents(v []*AuditEvent) *PutAuditEventsInput {
s.AuditEvents = v
return s
}
// SetChannelArn sets the ChannelArn field's value.
func (s *PutAuditEventsInput) SetChannelArn(v string) *PutAuditEventsInput {
s.ChannelArn = &v
return s
}
// SetExternalId sets the ExternalId field's value.
func (s *PutAuditEventsInput) SetExternalId(v string) *PutAuditEventsInput {
s.ExternalId = &v
return s
}
type PutAuditEventsOutput struct {
_ struct{} `type:"structure"`
// Lists events in the provided event payload that could not be ingested into
// CloudTrail, and includes the error code and error message returned for events
// that could not be ingested.
//
// Failed is a required field
Failed []*ResultErrorEntry `locationName:"failed" type:"list" required:"true"`
// Lists events in the provided event payload that were successfully ingested
// into CloudTrail.
//
// Successful is a required field
Successful []*AuditEventResultEntry `locationName:"successful" type:"list" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s PutAuditEventsOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s PutAuditEventsOutput) GoString() string {
return s.String()
}
// SetFailed sets the Failed field's value.
func (s *PutAuditEventsOutput) SetFailed(v []*ResultErrorEntry) *PutAuditEventsOutput {
s.Failed = v
return s
}
// SetSuccessful sets the Successful field's value.
func (s *PutAuditEventsOutput) SetSuccessful(v []*AuditEventResultEntry) *PutAuditEventsOutput {
s.Successful = v
return s
}
// Includes the error code and error message for events that could not be ingested
// by CloudTrail.
type ResultErrorEntry struct {
_ struct{} `type:"structure"`
// The error code for events that could not be ingested by CloudTrail. Possible
// error codes include: FieldTooLong, FieldNotFound, InvalidChecksum, InvalidData,
// InvalidRecipient, InvalidEventSource, AccountNotSubscribed, Throttling, and
// InternalFailure.
//
// ErrorCode is a required field
ErrorCode *string `locationName:"errorCode" min:"1" type:"string" required:"true"`
// The message that describes the error for events that could not be ingested
// by CloudTrail.
//
// ErrorMessage is a required field
ErrorMessage *string `locationName:"errorMessage" min:"1" type:"string" required:"true"`
// The original event ID from the source event that could not be ingested by
// CloudTrail.
//
// Id is a required field
Id *string `locationName:"id" min:"1" type:"string" required:"true"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ResultErrorEntry) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s ResultErrorEntry) GoString() string {
return s.String()
}
// SetErrorCode sets the ErrorCode field's value.
func (s *ResultErrorEntry) SetErrorCode(v string) *ResultErrorEntry {
s.ErrorCode = &v
return s
}
// SetErrorMessage sets the ErrorMessage field's value.
func (s *ResultErrorEntry) SetErrorMessage(v string) *ResultErrorEntry {
s.ErrorMessage = &v
return s
}
// SetId sets the Id field's value.
func (s *ResultErrorEntry) SetId(v string) *ResultErrorEntry {
s.Id = &v
return s
}
// The operation requested is not supported in this region or account.
type UnsupportedOperationException struct {
_ struct{} `type:"structure"`
RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
Message_ *string `locationName:"message" type:"string"`
}
// String returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s UnsupportedOperationException) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation.
//
// API parameter values that are decorated as "sensitive" in the API will not
// be included in the string output. The member name will be present, but the
// value will be replaced with "sensitive".
func (s UnsupportedOperationException) GoString() string {
return s.String()
}
func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error {
return &UnsupportedOperationException{
RespMetadata: v,
}
}
// Code returns the exception type name.
func (s *UnsupportedOperationException) Code() string {
return "UnsupportedOperationException"
}
// Message returns the exception's message.
func (s *UnsupportedOperationException) Message() string {
if s.Message_ != nil {
return *s.Message_
}
return ""
}
// OrigErr always returns nil, satisfies awserr.Error interface.
func (s *UnsupportedOperationException) OrigErr() error {
return nil
}
func (s *UnsupportedOperationException) Error() string {
return fmt.Sprintf("%s: %s", s.Code(), s.Message())
}
// Status code returns the HTTP status code for the request's response error.
func (s *UnsupportedOperationException) StatusCode() int {
return s.RespMetadata.StatusCode
}
// RequestID returns the service's response RequestID for request.
func (s *UnsupportedOperationException) RequestID() string {
return s.RespMetadata.RequestID
}