forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
1668 lines (1334 loc) · 50.6 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 iot1clickdevicesservice
import (
"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 opClaimDevicesByClaimCode = "ClaimDevicesByClaimCode"
// ClaimDevicesByClaimCodeRequest is a API request type for the ClaimDevicesByClaimCode API operation.
type ClaimDevicesByClaimCodeRequest struct {
*aws.Request
Input *ClaimDevicesByClaimCodeInput
Copy func(*ClaimDevicesByClaimCodeInput) ClaimDevicesByClaimCodeRequest
}
// Send marshals and sends the ClaimDevicesByClaimCode API request.
func (r ClaimDevicesByClaimCodeRequest) Send() (*ClaimDevicesByClaimCodeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ClaimDevicesByClaimCodeOutput), nil
}
// ClaimDevicesByClaimCodeRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Adds device(s) to your account (i.e., claim one or more devices) if and only
// if you received a claim code with the device(s).
//
// // Example sending a request using the ClaimDevicesByClaimCodeRequest method.
// req := client.ClaimDevicesByClaimCodeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode
func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCodeRequest(input *ClaimDevicesByClaimCodeInput) ClaimDevicesByClaimCodeRequest {
op := &aws.Operation{
Name: opClaimDevicesByClaimCode,
HTTPMethod: "PUT",
HTTPPath: "/claims/{claimCode}",
}
if input == nil {
input = &ClaimDevicesByClaimCodeInput{}
}
output := &ClaimDevicesByClaimCodeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ClaimDevicesByClaimCodeRequest{Request: req, Input: input, Copy: c.ClaimDevicesByClaimCodeRequest}
}
const opDescribeDevice = "DescribeDevice"
// DescribeDeviceRequest is a API request type for the DescribeDevice API operation.
type DescribeDeviceRequest struct {
*aws.Request
Input *DescribeDeviceInput
Copy func(*DescribeDeviceInput) DescribeDeviceRequest
}
// Send marshals and sends the DescribeDevice API request.
func (r DescribeDeviceRequest) Send() (*DescribeDeviceOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeDeviceOutput), nil
}
// DescribeDeviceRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Given a device ID, returns a DescribeDeviceResponse object describing the
// details of the device.
//
// // Example sending a request using the DescribeDeviceRequest method.
// req := client.DescribeDeviceRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice
func (c *IoT1ClickDevicesService) DescribeDeviceRequest(input *DescribeDeviceInput) DescribeDeviceRequest {
op := &aws.Operation{
Name: opDescribeDevice,
HTTPMethod: "GET",
HTTPPath: "/devices/{deviceId}",
}
if input == nil {
input = &DescribeDeviceInput{}
}
output := &DescribeDeviceOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeDeviceRequest{Request: req, Input: input, Copy: c.DescribeDeviceRequest}
}
const opFinalizeDeviceClaim = "FinalizeDeviceClaim"
// FinalizeDeviceClaimRequest is a API request type for the FinalizeDeviceClaim API operation.
type FinalizeDeviceClaimRequest struct {
*aws.Request
Input *FinalizeDeviceClaimInput
Copy func(*FinalizeDeviceClaimInput) FinalizeDeviceClaimRequest
}
// Send marshals and sends the FinalizeDeviceClaim API request.
func (r FinalizeDeviceClaimRequest) Send() (*FinalizeDeviceClaimOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*FinalizeDeviceClaimOutput), nil
}
// FinalizeDeviceClaimRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Given a device ID, finalizes the claim request for the associated device.
//
// Claiming a device consists of initiating a claim, then publishing a device
// event, and finalizing the claim. For a device of type button, a device event
// can be published by simply clicking the device.
//
// // Example sending a request using the FinalizeDeviceClaimRequest method.
// req := client.FinalizeDeviceClaimRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim
func (c *IoT1ClickDevicesService) FinalizeDeviceClaimRequest(input *FinalizeDeviceClaimInput) FinalizeDeviceClaimRequest {
op := &aws.Operation{
Name: opFinalizeDeviceClaim,
HTTPMethod: "PUT",
HTTPPath: "/devices/{deviceId}/finalize-claim",
}
if input == nil {
input = &FinalizeDeviceClaimInput{}
}
output := &FinalizeDeviceClaimOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return FinalizeDeviceClaimRequest{Request: req, Input: input, Copy: c.FinalizeDeviceClaimRequest}
}
const opGetDeviceMethods = "GetDeviceMethods"
// GetDeviceMethodsRequest is a API request type for the GetDeviceMethods API operation.
type GetDeviceMethodsRequest struct {
*aws.Request
Input *GetDeviceMethodsInput
Copy func(*GetDeviceMethodsInput) GetDeviceMethodsRequest
}
// Send marshals and sends the GetDeviceMethods API request.
func (r GetDeviceMethodsRequest) Send() (*GetDeviceMethodsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetDeviceMethodsOutput), nil
}
// GetDeviceMethodsRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Given a device ID, returns the invokable methods associated with the device.
//
// // Example sending a request using the GetDeviceMethodsRequest method.
// req := client.GetDeviceMethodsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods
func (c *IoT1ClickDevicesService) GetDeviceMethodsRequest(input *GetDeviceMethodsInput) GetDeviceMethodsRequest {
op := &aws.Operation{
Name: opGetDeviceMethods,
HTTPMethod: "GET",
HTTPPath: "/devices/{deviceId}/methods",
}
if input == nil {
input = &GetDeviceMethodsInput{}
}
output := &GetDeviceMethodsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetDeviceMethodsRequest{Request: req, Input: input, Copy: c.GetDeviceMethodsRequest}
}
const opInitiateDeviceClaim = "InitiateDeviceClaim"
// InitiateDeviceClaimRequest is a API request type for the InitiateDeviceClaim API operation.
type InitiateDeviceClaimRequest struct {
*aws.Request
Input *InitiateDeviceClaimInput
Copy func(*InitiateDeviceClaimInput) InitiateDeviceClaimRequest
}
// Send marshals and sends the InitiateDeviceClaim API request.
func (r InitiateDeviceClaimRequest) Send() (*InitiateDeviceClaimOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*InitiateDeviceClaimOutput), nil
}
// InitiateDeviceClaimRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Given a device ID, initiates a claim request for the associated device.
//
// Claiming a device consists of initiating a claim, then publishing a device
// event, and finalizing the claim. For a device of type button, a device event
// can be published by simply clicking the device.
//
// // Example sending a request using the InitiateDeviceClaimRequest method.
// req := client.InitiateDeviceClaimRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim
func (c *IoT1ClickDevicesService) InitiateDeviceClaimRequest(input *InitiateDeviceClaimInput) InitiateDeviceClaimRequest {
op := &aws.Operation{
Name: opInitiateDeviceClaim,
HTTPMethod: "PUT",
HTTPPath: "/devices/{deviceId}/initiate-claim",
}
if input == nil {
input = &InitiateDeviceClaimInput{}
}
output := &InitiateDeviceClaimOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return InitiateDeviceClaimRequest{Request: req, Input: input, Copy: c.InitiateDeviceClaimRequest}
}
const opInvokeDeviceMethod = "InvokeDeviceMethod"
// InvokeDeviceMethodRequest is a API request type for the InvokeDeviceMethod API operation.
type InvokeDeviceMethodRequest struct {
*aws.Request
Input *InvokeDeviceMethodInput
Copy func(*InvokeDeviceMethodInput) InvokeDeviceMethodRequest
}
// Send marshals and sends the InvokeDeviceMethod API request.
func (r InvokeDeviceMethodRequest) Send() (*InvokeDeviceMethodOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*InvokeDeviceMethodOutput), nil
}
// InvokeDeviceMethodRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Given a device ID, issues a request to invoke a named device method (with
// possible parameters). See the "Example POST" code snippet below.
//
// // Example sending a request using the InvokeDeviceMethodRequest method.
// req := client.InvokeDeviceMethodRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod
func (c *IoT1ClickDevicesService) InvokeDeviceMethodRequest(input *InvokeDeviceMethodInput) InvokeDeviceMethodRequest {
op := &aws.Operation{
Name: opInvokeDeviceMethod,
HTTPMethod: "POST",
HTTPPath: "/devices/{deviceId}/methods",
}
if input == nil {
input = &InvokeDeviceMethodInput{}
}
output := &InvokeDeviceMethodOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return InvokeDeviceMethodRequest{Request: req, Input: input, Copy: c.InvokeDeviceMethodRequest}
}
const opListDeviceEvents = "ListDeviceEvents"
// ListDeviceEventsRequest is a API request type for the ListDeviceEvents API operation.
type ListDeviceEventsRequest struct {
*aws.Request
Input *ListDeviceEventsInput
Copy func(*ListDeviceEventsInput) ListDeviceEventsRequest
}
// Send marshals and sends the ListDeviceEvents API request.
func (r ListDeviceEventsRequest) Send() (*ListDeviceEventsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListDeviceEventsOutput), nil
}
// ListDeviceEventsRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Using a device ID, returns a DeviceEventsResponse object containing an array
// of events for the device.
//
// // Example sending a request using the ListDeviceEventsRequest method.
// req := client.ListDeviceEventsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents
func (c *IoT1ClickDevicesService) ListDeviceEventsRequest(input *ListDeviceEventsInput) ListDeviceEventsRequest {
op := &aws.Operation{
Name: opListDeviceEvents,
HTTPMethod: "GET",
HTTPPath: "/devices/{deviceId}/events",
}
if input == nil {
input = &ListDeviceEventsInput{}
}
output := &ListDeviceEventsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListDeviceEventsRequest{Request: req, Input: input, Copy: c.ListDeviceEventsRequest}
}
const opListDevices = "ListDevices"
// ListDevicesRequest is a API request type for the ListDevices API operation.
type ListDevicesRequest struct {
*aws.Request
Input *ListDevicesInput
Copy func(*ListDevicesInput) ListDevicesRequest
}
// Send marshals and sends the ListDevices API request.
func (r ListDevicesRequest) Send() (*ListDevicesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListDevicesOutput), nil
}
// ListDevicesRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Lists the 1-Click compatible devices associated with your AWS account.
//
// // Example sending a request using the ListDevicesRequest method.
// req := client.ListDevicesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices
func (c *IoT1ClickDevicesService) ListDevicesRequest(input *ListDevicesInput) ListDevicesRequest {
op := &aws.Operation{
Name: opListDevices,
HTTPMethod: "GET",
HTTPPath: "/devices",
}
if input == nil {
input = &ListDevicesInput{}
}
output := &ListDevicesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListDevicesRequest{Request: req, Input: input, Copy: c.ListDevicesRequest}
}
const opUnclaimDevice = "UnclaimDevice"
// UnclaimDeviceRequest is a API request type for the UnclaimDevice API operation.
type UnclaimDeviceRequest struct {
*aws.Request
Input *UnclaimDeviceInput
Copy func(*UnclaimDeviceInput) UnclaimDeviceRequest
}
// Send marshals and sends the UnclaimDevice API request.
func (r UnclaimDeviceRequest) Send() (*UnclaimDeviceOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UnclaimDeviceOutput), nil
}
// UnclaimDeviceRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Disassociates a device from your AWS account using its device ID.
//
// // Example sending a request using the UnclaimDeviceRequest method.
// req := client.UnclaimDeviceRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice
func (c *IoT1ClickDevicesService) UnclaimDeviceRequest(input *UnclaimDeviceInput) UnclaimDeviceRequest {
op := &aws.Operation{
Name: opUnclaimDevice,
HTTPMethod: "PUT",
HTTPPath: "/devices/{deviceId}/unclaim",
}
if input == nil {
input = &UnclaimDeviceInput{}
}
output := &UnclaimDeviceOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UnclaimDeviceRequest{Request: req, Input: input, Copy: c.UnclaimDeviceRequest}
}
const opUpdateDeviceState = "UpdateDeviceState"
// UpdateDeviceStateRequest is a API request type for the UpdateDeviceState API operation.
type UpdateDeviceStateRequest struct {
*aws.Request
Input *UpdateDeviceStateInput
Copy func(*UpdateDeviceStateInput) UpdateDeviceStateRequest
}
// Send marshals and sends the UpdateDeviceState API request.
func (r UpdateDeviceStateRequest) Send() (*UpdateDeviceStateOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateDeviceStateOutput), nil
}
// UpdateDeviceStateRequest returns a request value for making API operation for
// AWS IoT 1-Click Devices Service.
//
// Using a Boolean value (true or false), this operation enables or disables
// the device given a device ID.
//
// // Example sending a request using the UpdateDeviceStateRequest method.
// req := client.UpdateDeviceStateRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState
func (c *IoT1ClickDevicesService) UpdateDeviceStateRequest(input *UpdateDeviceStateInput) UpdateDeviceStateRequest {
op := &aws.Operation{
Name: opUpdateDeviceState,
HTTPMethod: "PUT",
HTTPPath: "/devices/{deviceId}/state",
}
if input == nil {
input = &UpdateDeviceStateInput{}
}
output := &UpdateDeviceStateOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateDeviceStateRequest{Request: req, Input: input, Copy: c.UpdateDeviceStateRequest}
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/Attributes
type Attributes struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s Attributes) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Attributes) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Attributes) MarshalFields(e protocol.FieldEncoder) error {
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCodeRequest
type ClaimDevicesByClaimCodeInput struct {
_ struct{} `type:"structure"`
// ClaimCode is a required field
ClaimCode *string `location:"uri" locationName:"claimCode" type:"string" required:"true"`
}
// String returns the string representation
func (s ClaimDevicesByClaimCodeInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ClaimDevicesByClaimCodeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ClaimDevicesByClaimCodeInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ClaimDevicesByClaimCodeInput"}
if s.ClaimCode == nil {
invalidParams.Add(aws.NewErrParamRequired("ClaimCode"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s ClaimDevicesByClaimCodeInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/x-amz-json-1.1"), protocol.Metadata{})
if s.ClaimCode != nil {
v := *s.ClaimCode
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "claimCode", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCodeResponse
type ClaimDevicesByClaimCodeOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The claim code provided by the device manufacturer.
ClaimCode *string `locationName:"claimCode" min:"12" type:"string"`
// The total number of devices associated with the claim code that has been
// processed in the claim request.
Total *int64 `locationName:"total" type:"integer"`
}
// String returns the string representation
func (s ClaimDevicesByClaimCodeOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s ClaimDevicesByClaimCodeOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s ClaimDevicesByClaimCodeOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s ClaimDevicesByClaimCodeOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.ClaimCode != nil {
v := *s.ClaimCode
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "claimCode", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Total != nil {
v := *s.Total
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "total", protocol.Int64Value(v), metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDeviceRequest
type DescribeDeviceInput struct {
_ struct{} `type:"structure"`
// DeviceId is a required field
DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
}
// String returns the string representation
func (s DescribeDeviceInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeDeviceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeDeviceInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DescribeDeviceInput"}
if s.DeviceId == nil {
invalidParams.Add(aws.NewErrParamRequired("DeviceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DescribeDeviceInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/x-amz-json-1.1"), protocol.Metadata{})
if s.DeviceId != nil {
v := *s.DeviceId
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "deviceId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDeviceResponse
type DescribeDeviceOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// Device details.
DeviceDescription *DeviceDescription `locationName:"deviceDescription" type:"structure"`
}
// String returns the string representation
func (s DescribeDeviceOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DescribeDeviceOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s DescribeDeviceOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DescribeDeviceOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.DeviceDescription != nil {
v := s.DeviceDescription
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "deviceDescription", v, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/Device
type Device struct {
_ struct{} `type:"structure"`
// The user specified attributes associated with the device for an event.
Attributes *Attributes `locationName:"attributes" type:"structure"`
// The unique identifier of the device.
DeviceId *string `locationName:"deviceId" type:"string"`
// The device type, such as "button".
Type *string `locationName:"type" type:"string"`
}
// String returns the string representation
func (s Device) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Device) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s Device) MarshalFields(e protocol.FieldEncoder) error {
if s.Attributes != nil {
v := s.Attributes
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "attributes", v, metadata)
}
if s.DeviceId != nil {
v := *s.DeviceId
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "deviceId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Type != nil {
v := *s.Type
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "type", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DeviceDescription
type DeviceDescription struct {
_ struct{} `type:"structure"`
// An array of zero or more elements of DeviceAttribute objects providing user
// specified device attributes.
Attributes map[string]string `locationName:"attributes" type:"map"`
// The unique identifier of the device.
DeviceId *string `locationName:"deviceId" type:"string"`
// A Boolean value indicating whether or not the device is enabled.
Enabled *bool `locationName:"enabled" type:"boolean"`
// A value between 0 and 1 inclusive, representing the fraction of life remaining
// for the device.
RemainingLife *float64 `locationName:"remainingLife" type:"double"`
// The type of the device, such as "button".
Type *string `locationName:"type" type:"string"`
}
// String returns the string representation
func (s DeviceDescription) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeviceDescription) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeviceDescription) MarshalFields(e protocol.FieldEncoder) error {
if len(s.Attributes) > 0 {
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.DeviceId != nil {
v := *s.DeviceId
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "deviceId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Enabled != nil {
v := *s.Enabled
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "enabled", protocol.BoolValue(v), metadata)
}
if s.RemainingLife != nil {
v := *s.RemainingLife
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "remainingLife", protocol.Float64Value(v), metadata)
}
if s.Type != nil {
v := *s.Type
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "type", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DeviceEvent
type DeviceEvent struct {
_ struct{} `type:"structure"`
// An object representing the device associated with the event.
Device *Device `locationName:"device" type:"structure"`
// A serialized JSON object representing the device-type specific event.
StdEvent *string `locationName:"stdEvent" type:"string"`
}
// String returns the string representation
func (s DeviceEvent) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeviceEvent) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeviceEvent) MarshalFields(e protocol.FieldEncoder) error {
if s.Device != nil {
v := s.Device
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "device", v, metadata)
}
if s.StdEvent != nil {
v := *s.StdEvent
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "stdEvent", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DeviceMethod
type DeviceMethod struct {
_ struct{} `type:"structure"`
// The type of the device, such as "button".
DeviceType *string `locationName:"deviceType" type:"string"`
// The name of the method applicable to the deviceType.
MethodName *string `locationName:"methodName" type:"string"`
}
// String returns the string representation
func (s DeviceMethod) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeviceMethod) GoString() string {
return s.String()
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeviceMethod) MarshalFields(e protocol.FieldEncoder) error {
if s.DeviceType != nil {
v := *s.DeviceType
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "deviceType", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.MethodName != nil {
v := *s.MethodName
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "methodName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaimRequest
type FinalizeDeviceClaimInput struct {
_ struct{} `type:"structure"`
// DeviceId is a required field
DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
}
// String returns the string representation
func (s FinalizeDeviceClaimInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s FinalizeDeviceClaimInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *FinalizeDeviceClaimInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "FinalizeDeviceClaimInput"}
if s.DeviceId == nil {
invalidParams.Add(aws.NewErrParamRequired("DeviceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s FinalizeDeviceClaimInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/x-amz-json-1.1"), protocol.Metadata{})
if s.DeviceId != nil {
v := *s.DeviceId
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "deviceId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaimResponse
type FinalizeDeviceClaimOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
State *string `locationName:"state" type:"string"`
}
// String returns the string representation
func (s FinalizeDeviceClaimOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s FinalizeDeviceClaimOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s FinalizeDeviceClaimOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s FinalizeDeviceClaimOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.State != nil {
v := *s.State
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "state", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethodsRequest
type GetDeviceMethodsInput struct {
_ struct{} `type:"structure"`
// DeviceId is a required field
DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
}