-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_types.go
9732 lines (7855 loc) · 306 KB
/
api_types.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 iot
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"
)
var _ aws.Config
var _ = awsutil.Prettify
// Details of abort criteria to abort the job.
type AbortConfig struct {
_ struct{} `type:"structure"`
// The list of abort criteria to define rules to abort the job.
//
// CriteriaList is a required field
CriteriaList []AbortCriteria `locationName:"criteriaList" min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s AbortConfig) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AbortConfig) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AbortConfig"}
if s.CriteriaList == nil {
invalidParams.Add(aws.NewErrParamRequired("CriteriaList"))
}
if s.CriteriaList != nil && len(s.CriteriaList) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("CriteriaList", 1))
}
if s.CriteriaList != nil {
for i, v := range s.CriteriaList {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CriteriaList", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AbortConfig) MarshalFields(e protocol.FieldEncoder) error {
if s.CriteriaList != nil {
v := s.CriteriaList
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "criteriaList", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
return nil
}
// Details of abort criteria to define rules to abort the job.
type AbortCriteria struct {
_ struct{} `type:"structure"`
// The type of abort action to initiate a job abort.
//
// Action is a required field
Action AbortAction `locationName:"action" type:"string" required:"true" enum:"true"`
// The type of job execution failure to define a rule to initiate a job abort.
//
// FailureType is a required field
FailureType JobExecutionFailureType `locationName:"failureType" type:"string" required:"true" enum:"true"`
// Minimum number of executed things before evaluating an abort rule.
//
// MinNumberOfExecutedThings is a required field
MinNumberOfExecutedThings *int64 `locationName:"minNumberOfExecutedThings" min:"1" type:"integer" required:"true"`
// The threshold as a percentage of the total number of executed things that
// will initiate a job abort.
//
// AWS IoT supports up to two digits after the decimal (for example, 10.9 and
// 10.99, but not 10.999).
//
// ThresholdPercentage is a required field
ThresholdPercentage *float64 `locationName:"thresholdPercentage" type:"double" required:"true"`
}
// String returns the string representation
func (s AbortCriteria) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AbortCriteria) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AbortCriteria"}
if len(s.Action) == 0 {
invalidParams.Add(aws.NewErrParamRequired("Action"))
}
if len(s.FailureType) == 0 {
invalidParams.Add(aws.NewErrParamRequired("FailureType"))
}
if s.MinNumberOfExecutedThings == nil {
invalidParams.Add(aws.NewErrParamRequired("MinNumberOfExecutedThings"))
}
if s.MinNumberOfExecutedThings != nil && *s.MinNumberOfExecutedThings < 1 {
invalidParams.Add(aws.NewErrParamMinValue("MinNumberOfExecutedThings", 1))
}
if s.ThresholdPercentage == nil {
invalidParams.Add(aws.NewErrParamRequired("ThresholdPercentage"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AbortCriteria) MarshalFields(e protocol.FieldEncoder) error {
if len(s.Action) > 0 {
v := s.Action
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "action", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if len(s.FailureType) > 0 {
v := s.FailureType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "failureType", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.MinNumberOfExecutedThings != nil {
v := *s.MinNumberOfExecutedThings
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "minNumberOfExecutedThings", protocol.Int64Value(v), metadata)
}
if s.ThresholdPercentage != nil {
v := *s.ThresholdPercentage
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "thresholdPercentage", protocol.Float64Value(v), metadata)
}
return nil
}
// Describes the actions associated with a rule.
type Action struct {
_ struct{} `type:"structure"`
// Change the state of a CloudWatch alarm.
CloudwatchAlarm *CloudwatchAlarmAction `locationName:"cloudwatchAlarm" type:"structure"`
// Capture a CloudWatch metric.
CloudwatchMetric *CloudwatchMetricAction `locationName:"cloudwatchMetric" type:"structure"`
// Write to a DynamoDB table.
DynamoDB *DynamoDBAction `locationName:"dynamoDB" type:"structure"`
// Write to a DynamoDB table. This is a new version of the DynamoDB action.
// It allows you to write each attribute in an MQTT message payload into a separate
// DynamoDB column.
DynamoDBv2 *DynamoDBv2Action `locationName:"dynamoDBv2" type:"structure"`
// Write data to an Amazon Elasticsearch Service domain.
Elasticsearch *ElasticsearchAction `locationName:"elasticsearch" type:"structure"`
// Write to an Amazon Kinesis Firehose stream.
Firehose *FirehoseAction `locationName:"firehose" type:"structure"`
// Send data to an HTTPS endpoint.
Http *HttpAction `locationName:"http" type:"structure"`
// Sends message data to an AWS IoT Analytics channel.
IotAnalytics *IotAnalyticsAction `locationName:"iotAnalytics" type:"structure"`
// Sends an input to an AWS IoT Events detector.
IotEvents *IotEventsAction `locationName:"iotEvents" type:"structure"`
// Sends data from the MQTT message that triggered the rule to AWS IoT SiteWise
// asset properties.
IotSiteWise *IotSiteWiseAction `locationName:"iotSiteWise" type:"structure"`
// Write data to an Amazon Kinesis stream.
Kinesis *KinesisAction `locationName:"kinesis" type:"structure"`
// Invoke a Lambda function.
Lambda *LambdaAction `locationName:"lambda" type:"structure"`
// Publish to another MQTT topic.
Republish *RepublishAction `locationName:"republish" type:"structure"`
// Write to an Amazon S3 bucket.
S3 *S3Action `locationName:"s3" type:"structure"`
// Send a message to a Salesforce IoT Cloud Input Stream.
Salesforce *SalesforceAction `locationName:"salesforce" type:"structure"`
// Publish to an Amazon SNS topic.
Sns *SnsAction `locationName:"sns" type:"structure"`
// Publish to an Amazon SQS queue.
Sqs *SqsAction `locationName:"sqs" type:"structure"`
// Starts execution of a Step Functions state machine.
StepFunctions *StepFunctionsAction `locationName:"stepFunctions" type:"structure"`
}
// String returns the string representation
func (s Action) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Action) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "Action"}
if s.CloudwatchAlarm != nil {
if err := s.CloudwatchAlarm.Validate(); err != nil {
invalidParams.AddNested("CloudwatchAlarm", err.(aws.ErrInvalidParams))
}
}
if s.CloudwatchMetric != nil {
if err := s.CloudwatchMetric.Validate(); err != nil {
invalidParams.AddNested("CloudwatchMetric", err.(aws.ErrInvalidParams))
}
}
if s.DynamoDB != nil {
if err := s.DynamoDB.Validate(); err != nil {
invalidParams.AddNested("DynamoDB", err.(aws.ErrInvalidParams))
}
}
if s.DynamoDBv2 != nil {
if err := s.DynamoDBv2.Validate(); err != nil {
invalidParams.AddNested("DynamoDBv2", err.(aws.ErrInvalidParams))
}
}
if s.Elasticsearch != nil {
if err := s.Elasticsearch.Validate(); err != nil {
invalidParams.AddNested("Elasticsearch", err.(aws.ErrInvalidParams))
}
}
if s.Firehose != nil {
if err := s.Firehose.Validate(); err != nil {
invalidParams.AddNested("Firehose", err.(aws.ErrInvalidParams))
}
}
if s.Http != nil {
if err := s.Http.Validate(); err != nil {
invalidParams.AddNested("Http", err.(aws.ErrInvalidParams))
}
}
if s.IotEvents != nil {
if err := s.IotEvents.Validate(); err != nil {
invalidParams.AddNested("IotEvents", err.(aws.ErrInvalidParams))
}
}
if s.IotSiteWise != nil {
if err := s.IotSiteWise.Validate(); err != nil {
invalidParams.AddNested("IotSiteWise", err.(aws.ErrInvalidParams))
}
}
if s.Kinesis != nil {
if err := s.Kinesis.Validate(); err != nil {
invalidParams.AddNested("Kinesis", err.(aws.ErrInvalidParams))
}
}
if s.Lambda != nil {
if err := s.Lambda.Validate(); err != nil {
invalidParams.AddNested("Lambda", err.(aws.ErrInvalidParams))
}
}
if s.Republish != nil {
if err := s.Republish.Validate(); err != nil {
invalidParams.AddNested("Republish", err.(aws.ErrInvalidParams))
}
}
if s.S3 != nil {
if err := s.S3.Validate(); err != nil {
invalidParams.AddNested("S3", err.(aws.ErrInvalidParams))
}
}
if s.Salesforce != nil {
if err := s.Salesforce.Validate(); err != nil {
invalidParams.AddNested("Salesforce", err.(aws.ErrInvalidParams))
}
}
if s.Sns != nil {
if err := s.Sns.Validate(); err != nil {
invalidParams.AddNested("Sns", err.(aws.ErrInvalidParams))
}
}
if s.Sqs != nil {
if err := s.Sqs.Validate(); err != nil {
invalidParams.AddNested("Sqs", err.(aws.ErrInvalidParams))
}
}
if s.StepFunctions != nil {
if err := s.StepFunctions.Validate(); err != nil {
invalidParams.AddNested("StepFunctions", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Action) MarshalFields(e protocol.FieldEncoder) error {
if s.CloudwatchAlarm != nil {
v := s.CloudwatchAlarm
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "cloudwatchAlarm", v, metadata)
}
if s.CloudwatchMetric != nil {
v := s.CloudwatchMetric
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "cloudwatchMetric", v, metadata)
}
if s.DynamoDB != nil {
v := s.DynamoDB
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "dynamoDB", v, metadata)
}
if s.DynamoDBv2 != nil {
v := s.DynamoDBv2
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "dynamoDBv2", v, metadata)
}
if s.Elasticsearch != nil {
v := s.Elasticsearch
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "elasticsearch", v, metadata)
}
if s.Firehose != nil {
v := s.Firehose
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "firehose", v, metadata)
}
if s.Http != nil {
v := s.Http
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "http", v, metadata)
}
if s.IotAnalytics != nil {
v := s.IotAnalytics
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "iotAnalytics", v, metadata)
}
if s.IotEvents != nil {
v := s.IotEvents
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "iotEvents", v, metadata)
}
if s.IotSiteWise != nil {
v := s.IotSiteWise
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "iotSiteWise", v, metadata)
}
if s.Kinesis != nil {
v := s.Kinesis
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "kinesis", v, metadata)
}
if s.Lambda != nil {
v := s.Lambda
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "lambda", v, metadata)
}
if s.Republish != nil {
v := s.Republish
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "republish", v, metadata)
}
if s.S3 != nil {
v := s.S3
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "s3", v, metadata)
}
if s.Salesforce != nil {
v := s.Salesforce
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "salesforce", v, metadata)
}
if s.Sns != nil {
v := s.Sns
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "sns", v, metadata)
}
if s.Sqs != nil {
v := s.Sqs
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "sqs", v, metadata)
}
if s.StepFunctions != nil {
v := s.StepFunctions
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "stepFunctions", v, metadata)
}
return nil
}
// Information about an active Device Defender security profile behavior violation.
type ActiveViolation struct {
_ struct{} `type:"structure"`
// The behavior which is being violated.
Behavior *Behavior `locationName:"behavior" type:"structure"`
// The time the most recent violation occurred.
LastViolationTime *time.Time `locationName:"lastViolationTime" type:"timestamp"`
// The value of the metric (the measurement) which caused the most recent violation.
LastViolationValue *MetricValue `locationName:"lastViolationValue" type:"structure"`
// The security profile whose behavior is in violation.
SecurityProfileName *string `locationName:"securityProfileName" min:"1" type:"string"`
// The name of the thing responsible for the active violation.
ThingName *string `locationName:"thingName" min:"1" type:"string"`
// The ID of the active violation.
ViolationId *string `locationName:"violationId" min:"1" type:"string"`
// The time the violation started.
ViolationStartTime *time.Time `locationName:"violationStartTime" type:"timestamp"`
}
// String returns the string representation
func (s ActiveViolation) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s ActiveViolation) MarshalFields(e protocol.FieldEncoder) error {
if s.Behavior != nil {
v := s.Behavior
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "behavior", v, metadata)
}
if s.LastViolationTime != nil {
v := *s.LastViolationTime
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "lastViolationTime",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
if s.LastViolationValue != nil {
v := s.LastViolationValue
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "lastViolationValue", v, metadata)
}
if s.SecurityProfileName != nil {
v := *s.SecurityProfileName
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "securityProfileName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.ThingName != nil {
v := *s.ThingName
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "thingName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.ViolationId != nil {
v := *s.ViolationId
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "violationId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.ViolationStartTime != nil {
v := *s.ViolationStartTime
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "violationStartTime",
protocol.TimeValue{V: v, Format: protocol.UnixTimeFormatName, QuotedFormatTime: true}, metadata)
}
return nil
}
// Parameters used when defining a mitigation action that move a set of things
// to a thing group.
type AddThingsToThingGroupParams struct {
_ struct{} `type:"structure"`
// Specifies if this mitigation action can move the things that triggered the
// mitigation action even if they are part of one or more dynamic things groups.
OverrideDynamicGroups *bool `locationName:"overrideDynamicGroups" type:"boolean"`
// The list of groups to which you want to add the things that triggered the
// mitigation action. You can add a thing to a maximum of 10 groups, but you
// cannot add a thing to more than one group in the same hierarchy.
//
// ThingGroupNames is a required field
ThingGroupNames []string `locationName:"thingGroupNames" min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s AddThingsToThingGroupParams) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddThingsToThingGroupParams) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AddThingsToThingGroupParams"}
if s.ThingGroupNames == nil {
invalidParams.Add(aws.NewErrParamRequired("ThingGroupNames"))
}
if s.ThingGroupNames != nil && len(s.ThingGroupNames) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ThingGroupNames", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AddThingsToThingGroupParams) MarshalFields(e protocol.FieldEncoder) error {
if s.OverrideDynamicGroups != nil {
v := *s.OverrideDynamicGroups
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "overrideDynamicGroups", protocol.BoolValue(v), metadata)
}
if s.ThingGroupNames != nil {
v := s.ThingGroupNames
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "thingGroupNames", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddValue(protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ls0.End()
}
return nil
}
// A structure containing the alert target ARN and the role ARN.
type AlertTarget struct {
_ struct{} `type:"structure"`
// The ARN of the notification target to which alerts are sent.
//
// AlertTargetArn is a required field
AlertTargetArn *string `locationName:"alertTargetArn" type:"string" required:"true"`
// The ARN of the role that grants permission to send alerts to the notification
// target.
//
// RoleArn is a required field
RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"`
}
// String returns the string representation
func (s AlertTarget) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AlertTarget) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AlertTarget"}
if s.AlertTargetArn == nil {
invalidParams.Add(aws.NewErrParamRequired("AlertTargetArn"))
}
if s.RoleArn == nil {
invalidParams.Add(aws.NewErrParamRequired("RoleArn"))
}
if s.RoleArn != nil && len(*s.RoleArn) < 20 {
invalidParams.Add(aws.NewErrParamMinLen("RoleArn", 20))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AlertTarget) MarshalFields(e protocol.FieldEncoder) error {
if s.AlertTargetArn != nil {
v := *s.AlertTargetArn
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "alertTargetArn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.RoleArn != nil {
v := *s.RoleArn
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "roleArn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Contains information that allowed the authorization.
type Allowed struct {
_ struct{} `type:"structure"`
// A list of policies that allowed the authentication.
Policies []Policy `locationName:"policies" type:"list"`
}
// String returns the string representation
func (s Allowed) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Allowed) MarshalFields(e protocol.FieldEncoder) error {
if s.Policies != nil {
v := s.Policies
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "policies", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
return nil
}
// An asset property timestamp entry containing the following information.
type AssetPropertyTimestamp struct {
_ struct{} `type:"structure"`
// Optional. A string that contains the nanosecond time offset. Accepts substitution
// templates.
OffsetInNanos *string `locationName:"offsetInNanos" type:"string"`
// A string that contains the time in seconds since epoch. Accepts substitution
// templates.
//
// TimeInSeconds is a required field
TimeInSeconds *string `locationName:"timeInSeconds" type:"string" required:"true"`
}
// String returns the string representation
func (s AssetPropertyTimestamp) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AssetPropertyTimestamp) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AssetPropertyTimestamp"}
if s.TimeInSeconds == nil {
invalidParams.Add(aws.NewErrParamRequired("TimeInSeconds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AssetPropertyTimestamp) MarshalFields(e protocol.FieldEncoder) error {
if s.OffsetInNanos != nil {
v := *s.OffsetInNanos
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "offsetInNanos", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.TimeInSeconds != nil {
v := *s.TimeInSeconds
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "timeInSeconds", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// An asset property value entry containing the following information.
type AssetPropertyValue struct {
_ struct{} `type:"structure"`
// Optional. A string that describes the quality of the value. Accepts substitution
// templates. Must be GOOD, BAD, or UNCERTAIN.
Quality *string `locationName:"quality" type:"string"`
// The asset property value timestamp.
//
// Timestamp is a required field
Timestamp *AssetPropertyTimestamp `locationName:"timestamp" type:"structure" required:"true"`
// The value of the asset property.
//
// Value is a required field
Value *AssetPropertyVariant `locationName:"value" type:"structure" required:"true"`
}
// String returns the string representation
func (s AssetPropertyValue) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AssetPropertyValue) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AssetPropertyValue"}
if s.Timestamp == nil {
invalidParams.Add(aws.NewErrParamRequired("Timestamp"))
}
if s.Value == nil {
invalidParams.Add(aws.NewErrParamRequired("Value"))
}
if s.Timestamp != nil {
if err := s.Timestamp.Validate(); err != nil {
invalidParams.AddNested("Timestamp", err.(aws.ErrInvalidParams))
}
}
if s.Value != nil {
if err := s.Value.Validate(); err != nil {
invalidParams.AddNested("Value", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AssetPropertyValue) MarshalFields(e protocol.FieldEncoder) error {
if s.Quality != nil {
v := *s.Quality
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "quality", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Timestamp != nil {
v := s.Timestamp
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "timestamp", v, metadata)
}
if s.Value != nil {
v := s.Value
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "value", v, metadata)
}
return nil
}
// Contains an asset property value (of a single type).
type AssetPropertyVariant struct {
_ struct{} `type:"structure"`
// Optional. A string that contains the boolean value (true or false) of the
// value entry. Accepts substitution templates.
BooleanValue *string `locationName:"booleanValue" type:"string"`
// Optional. A string that contains the double value of the value entry. Accepts
// substitution templates.
DoubleValue *string `locationName:"doubleValue" type:"string"`
// Optional. A string that contains the integer value of the value entry. Accepts
// substitution templates.
IntegerValue *string `locationName:"integerValue" type:"string"`
// Optional. The string value of the value entry. Accepts substitution templates.
StringValue *string `locationName:"stringValue" min:"1" type:"string"`
}
// String returns the string representation
func (s AssetPropertyVariant) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AssetPropertyVariant) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AssetPropertyVariant"}
if s.StringValue != nil && len(*s.StringValue) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("StringValue", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AssetPropertyVariant) MarshalFields(e protocol.FieldEncoder) error {
if s.BooleanValue != nil {
v := *s.BooleanValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "booleanValue", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.DoubleValue != nil {
v := *s.DoubleValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "doubleValue", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.IntegerValue != nil {
v := *s.IntegerValue
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "integerValue", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(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
}
// The attribute payload.
type AttributePayload struct {
_ struct{} `type:"structure"`
// A JSON string containing up to three key-value pair in JSON format. For example:
//
// {\"attributes\":{\"string1\":\"string2\"}}
Attributes map[string]string `locationName:"attributes" type:"map"`
// Specifies whether the list of attributes provided in the AttributePayload
// is merged with the attributes stored in the registry, instead of overwriting
// them.
//
// To remove an attribute, call UpdateThing with an empty attribute value.
//
// The merge attribute is only valid when calling UpdateThing or UpdateThingGroup.
Merge *bool `locationName:"merge" type:"boolean"`
}
// String returns the string representation
func (s AttributePayload) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AttributePayload) MarshalFields(e protocol.FieldEncoder) error {
if s.Attributes != nil {
v := s.Attributes
metadata := protocol.Metadata{}
ms0 := e.Map(protocol.BodyTarget, "attributes", metadata)
ms0.Start()
for k1, v1 := range v {
ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ms0.End()
}
if s.Merge != nil {
v := *s.Merge
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "merge", protocol.BoolValue(v), metadata)
}
return nil
}
// Which audit checks are enabled and disabled for this account.
type AuditCheckConfiguration struct {
_ struct{} `type:"structure"`
// True if this audit check is enabled for this account.
Enabled *bool `locationName:"enabled" type:"boolean"`
}
// String returns the string representation
func (s AuditCheckConfiguration) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AuditCheckConfiguration) MarshalFields(e protocol.FieldEncoder) error {
if s.Enabled != nil {
v := *s.Enabled
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "enabled", protocol.BoolValue(v), metadata)
}
return nil
}
// Information about the audit check.
type AuditCheckDetails struct {
_ struct{} `type:"structure"`
// True if the check is complete and found all resources compliant.
CheckCompliant *bool `locationName:"checkCompliant" type:"boolean"`
// The completion status of this check. One of "IN_PROGRESS", "WAITING_FOR_DATA_COLLECTION",
// "CANCELED", "COMPLETED_COMPLIANT", "COMPLETED_NON_COMPLIANT", or "FAILED".
CheckRunStatus AuditCheckRunStatus `locationName:"checkRunStatus" type:"string" enum:"true"`
// The code of any error encountered when this check is performed during this
// audit. One of "INSUFFICIENT_PERMISSIONS" or "AUDIT_CHECK_DISABLED".
ErrorCode *string `locationName:"errorCode" type:"string"`
// The message associated with any error encountered when this check is performed
// during this audit.
Message *string `locationName:"message" type:"string"`
// The number of resources that were found noncompliant during the check.
NonCompliantResourcesCount *int64 `locationName:"nonCompliantResourcesCount" type:"long"`
// The number of resources on which the check was performed.
TotalResourcesCount *int64 `locationName:"totalResourcesCount" type:"long"`
}
// String returns the string representation
func (s AuditCheckDetails) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s AuditCheckDetails) MarshalFields(e protocol.FieldEncoder) error {
if s.CheckCompliant != nil {
v := *s.CheckCompliant
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "checkCompliant", protocol.BoolValue(v), metadata)
}
if len(s.CheckRunStatus) > 0 {
v := s.CheckRunStatus
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "checkRunStatus", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.ErrorCode != nil {
v := *s.ErrorCode
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "errorCode", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Message != nil {
v := *s.Message
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "message", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.NonCompliantResourcesCount != nil {
v := *s.NonCompliantResourcesCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "nonCompliantResourcesCount", protocol.Int64Value(v), metadata)
}
if s.TotalResourcesCount != nil {
v := *s.TotalResourcesCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "totalResourcesCount", protocol.Int64Value(v), metadata)