forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
11289 lines (9752 loc) · 346 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
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package iot provides a client for AWS IoT.
package iot
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
const opAcceptCertificateTransfer = "AcceptCertificateTransfer"
// AcceptCertificateTransferRequest generates a "aws/request.Request" representing the
// client's request for the AcceptCertificateTransfer operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See AcceptCertificateTransfer for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AcceptCertificateTransfer method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AcceptCertificateTransferRequest method.
// req, resp := client.AcceptCertificateTransferRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) AcceptCertificateTransferRequest(input *AcceptCertificateTransferInput) (req *request.Request, output *AcceptCertificateTransferOutput) {
op := &request.Operation{
Name: opAcceptCertificateTransfer,
HTTPMethod: "PATCH",
HTTPPath: "/accept-certificate-transfer/{certificateId}",
}
if input == nil {
input = &AcceptCertificateTransferInput{}
}
output = &AcceptCertificateTransferOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AcceptCertificateTransfer API operation for AWS IoT.
//
// Accepts a pending certificate transfer. The default state of the certificate
// is INACTIVE.
//
// To check for pending certificate transfers, call ListCertificates to enumerate
// your certificates.
//
// 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 IoT's
// API operation AcceptCertificateTransfer for usage and error information.
//
// Returned Error Codes:
// * ResourceNotFoundException
// The specified resource does not exist.
//
// * TransferAlreadyCompletedException
// You can't revert the certificate transfer because the transfer is already
// complete.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) AcceptCertificateTransfer(input *AcceptCertificateTransferInput) (*AcceptCertificateTransferOutput, error) {
req, out := c.AcceptCertificateTransferRequest(input)
err := req.Send()
return out, err
}
const opAttachPrincipalPolicy = "AttachPrincipalPolicy"
// AttachPrincipalPolicyRequest generates a "aws/request.Request" representing the
// client's request for the AttachPrincipalPolicy operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See AttachPrincipalPolicy for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AttachPrincipalPolicy method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AttachPrincipalPolicyRequest method.
// req, resp := client.AttachPrincipalPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) AttachPrincipalPolicyRequest(input *AttachPrincipalPolicyInput) (req *request.Request, output *AttachPrincipalPolicyOutput) {
op := &request.Operation{
Name: opAttachPrincipalPolicy,
HTTPMethod: "PUT",
HTTPPath: "/principal-policies/{policyName}",
}
if input == nil {
input = &AttachPrincipalPolicyInput{}
}
output = &AttachPrincipalPolicyOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AttachPrincipalPolicy API operation for AWS IoT.
//
// Attaches the specified policy to the specified principal (certificate or
// other credential).
//
// 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 IoT's
// API operation AttachPrincipalPolicy for usage and error information.
//
// Returned Error Codes:
// * ResourceNotFoundException
// The specified resource does not exist.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
// * LimitExceededException
// The number of attached entities exceeds the limit.
//
func (c *IoT) AttachPrincipalPolicy(input *AttachPrincipalPolicyInput) (*AttachPrincipalPolicyOutput, error) {
req, out := c.AttachPrincipalPolicyRequest(input)
err := req.Send()
return out, err
}
const opAttachThingPrincipal = "AttachThingPrincipal"
// AttachThingPrincipalRequest generates a "aws/request.Request" representing the
// client's request for the AttachThingPrincipal operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See AttachThingPrincipal for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AttachThingPrincipal method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AttachThingPrincipalRequest method.
// req, resp := client.AttachThingPrincipalRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) AttachThingPrincipalRequest(input *AttachThingPrincipalInput) (req *request.Request, output *AttachThingPrincipalOutput) {
op := &request.Operation{
Name: opAttachThingPrincipal,
HTTPMethod: "PUT",
HTTPPath: "/things/{thingName}/principals",
}
if input == nil {
input = &AttachThingPrincipalInput{}
}
output = &AttachThingPrincipalOutput{}
req = c.newRequest(op, input, output)
return
}
// AttachThingPrincipal API operation for AWS IoT.
//
// Attaches the specified principal to the specified thing.
//
// 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 IoT's
// API operation AttachThingPrincipal for usage and error information.
//
// Returned Error Codes:
// * ResourceNotFoundException
// The specified resource does not exist.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) AttachThingPrincipal(input *AttachThingPrincipalInput) (*AttachThingPrincipalOutput, error) {
req, out := c.AttachThingPrincipalRequest(input)
err := req.Send()
return out, err
}
const opCancelCertificateTransfer = "CancelCertificateTransfer"
// CancelCertificateTransferRequest generates a "aws/request.Request" representing the
// client's request for the CancelCertificateTransfer operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CancelCertificateTransfer for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CancelCertificateTransfer method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CancelCertificateTransferRequest method.
// req, resp := client.CancelCertificateTransferRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CancelCertificateTransferRequest(input *CancelCertificateTransferInput) (req *request.Request, output *CancelCertificateTransferOutput) {
op := &request.Operation{
Name: opCancelCertificateTransfer,
HTTPMethod: "PATCH",
HTTPPath: "/cancel-certificate-transfer/{certificateId}",
}
if input == nil {
input = &CancelCertificateTransferInput{}
}
output = &CancelCertificateTransferOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// CancelCertificateTransfer API operation for AWS IoT.
//
// Cancels a pending transfer for the specified certificate.
//
// Note Only the transfer source account can use this operation to cancel a
// transfer. (Transfer destinations can use RejectCertificateTransfer instead.)
// After transfer, AWS IoT returns the certificate to the source account in
// the INACTIVE state. After the destination account has accepted the transfer,
// the transfer cannot be cancelled.
//
// After a certificate transfer is cancelled, the status of the certificate
// changes from PENDING_TRANSFER to INACTIVE.
//
// 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 IoT's
// API operation CancelCertificateTransfer for usage and error information.
//
// Returned Error Codes:
// * ResourceNotFoundException
// The specified resource does not exist.
//
// * TransferAlreadyCompletedException
// You can't revert the certificate transfer because the transfer is already
// complete.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) CancelCertificateTransfer(input *CancelCertificateTransferInput) (*CancelCertificateTransferOutput, error) {
req, out := c.CancelCertificateTransferRequest(input)
err := req.Send()
return out, err
}
const opCreateCertificateFromCsr = "CreateCertificateFromCsr"
// CreateCertificateFromCsrRequest generates a "aws/request.Request" representing the
// client's request for the CreateCertificateFromCsr operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateCertificateFromCsr for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateCertificateFromCsr method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateCertificateFromCsrRequest method.
// req, resp := client.CreateCertificateFromCsrRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreateCertificateFromCsrRequest(input *CreateCertificateFromCsrInput) (req *request.Request, output *CreateCertificateFromCsrOutput) {
op := &request.Operation{
Name: opCreateCertificateFromCsr,
HTTPMethod: "POST",
HTTPPath: "/certificates",
}
if input == nil {
input = &CreateCertificateFromCsrInput{}
}
output = &CreateCertificateFromCsrOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateCertificateFromCsr API operation for AWS IoT.
//
// Creates an X.509 certificate using the specified certificate signing request.
//
// Note Reusing the same certificate signing request (CSR) results in a distinct
// certificate.
//
// You can create multiple certificates in a batch by creating a directory,
// copying multiple .csr files into that directory, and then specifying that
// directory on the command line. The following commands show how to create
// a batch of certificates given a batch of CSRs.
//
// Assuming a set of CSRs are located inside of the directory my-csr-directory:
//
// On Linux and OS X, the command is:
//
// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr
// --certificate-signing-request file://my-csr-directory/{}
//
// This command lists all of the CSRs in my-csr-directory and pipes each CSR
// file name to the aws iot create-certificate-from-csr AWS CLI command to create
// a certificate for the corresponding CSR.
//
// The aws iot create-certificate-from-csr part of the command can also be run
// in parallel to speed up the certificate creation process:
//
// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr
// --certificate-signing-request file://my-csr-directory/{}
//
// On Windows PowerShell, the command to create certificates for all CSRs in
// my-csr-directory is:
//
// > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request
// file://my-csr-directory/$_}
//
// On a Windows command prompt, the command to create certificates for all CSRs
// in my-csr-directory is:
//
// > forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr
// --certificate-signing-request file://@path"
//
// 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 IoT's
// API operation CreateCertificateFromCsr for usage and error information.
//
// Returned Error Codes:
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) CreateCertificateFromCsr(input *CreateCertificateFromCsrInput) (*CreateCertificateFromCsrOutput, error) {
req, out := c.CreateCertificateFromCsrRequest(input)
err := req.Send()
return out, err
}
const opCreateKeysAndCertificate = "CreateKeysAndCertificate"
// CreateKeysAndCertificateRequest generates a "aws/request.Request" representing the
// client's request for the CreateKeysAndCertificate operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateKeysAndCertificate for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateKeysAndCertificate method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateKeysAndCertificateRequest method.
// req, resp := client.CreateKeysAndCertificateRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInput) (req *request.Request, output *CreateKeysAndCertificateOutput) {
op := &request.Operation{
Name: opCreateKeysAndCertificate,
HTTPMethod: "POST",
HTTPPath: "/keys-and-certificate",
}
if input == nil {
input = &CreateKeysAndCertificateInput{}
}
output = &CreateKeysAndCertificateOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateKeysAndCertificate API operation for AWS IoT.
//
// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the
// issued public key.
//
// Note This is the only time AWS IoT issues the private key for this certificate,
// so it is important to keep it in a secure location.
//
// 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 IoT's
// API operation CreateKeysAndCertificate for usage and error information.
//
// Returned Error Codes:
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) CreateKeysAndCertificate(input *CreateKeysAndCertificateInput) (*CreateKeysAndCertificateOutput, error) {
req, out := c.CreateKeysAndCertificateRequest(input)
err := req.Send()
return out, err
}
const opCreatePolicy = "CreatePolicy"
// CreatePolicyRequest generates a "aws/request.Request" representing the
// client's request for the CreatePolicy operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreatePolicy for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreatePolicy method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreatePolicyRequest method.
// req, resp := client.CreatePolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) {
op := &request.Operation{
Name: opCreatePolicy,
HTTPMethod: "POST",
HTTPPath: "/policies/{policyName}",
}
if input == nil {
input = &CreatePolicyInput{}
}
output = &CreatePolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePolicy API operation for AWS IoT.
//
// Creates an AWS IoT policy.
//
// The created policy is the default version for the policy. This operation
// creates a policy version with a version identifier of 1 and sets 1 as the
// policy's default version.
//
// 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 IoT's
// API operation CreatePolicy for usage and error information.
//
// Returned Error Codes:
// * ResourceAlreadyExistsException
// The resource already exists.
//
// * MalformedPolicyException
// The policy documentation is not valid.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) {
req, out := c.CreatePolicyRequest(input)
err := req.Send()
return out, err
}
const opCreatePolicyVersion = "CreatePolicyVersion"
// CreatePolicyVersionRequest generates a "aws/request.Request" representing the
// client's request for the CreatePolicyVersion operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreatePolicyVersion for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreatePolicyVersion method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreatePolicyVersionRequest method.
// req, resp := client.CreatePolicyVersionRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req *request.Request, output *CreatePolicyVersionOutput) {
op := &request.Operation{
Name: opCreatePolicyVersion,
HTTPMethod: "POST",
HTTPPath: "/policies/{policyName}/version",
}
if input == nil {
input = &CreatePolicyVersionInput{}
}
output = &CreatePolicyVersionOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePolicyVersion API operation for AWS IoT.
//
// Creates a new version of the specified AWS IoT policy. To update a policy,
// create a new policy version. A managed policy can have up to five versions.
// If the policy has five versions, you must use DeletePolicyVersion to delete
// an existing version before you create a new one.
//
// Optionally, you can set the new version as the policy's default version.
// The default version is the operative version (that is, the version that is
// in effect for the certificates to which the policy is attached).
//
// 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 IoT's
// API operation CreatePolicyVersion for usage and error information.
//
// Returned Error Codes:
// * ResourceNotFoundException
// The specified resource does not exist.
//
// * MalformedPolicyException
// The policy documentation is not valid.
//
// * VersionsLimitExceededException
// The number of policy versions exceeds the limit.
//
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
func (c *IoT) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) {
req, out := c.CreatePolicyVersionRequest(input)
err := req.Send()
return out, err
}
const opCreateThing = "CreateThing"
// CreateThingRequest generates a "aws/request.Request" representing the
// client's request for the CreateThing operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateThing for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateThing method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateThingRequest method.
// req, resp := client.CreateThingRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreateThingRequest(input *CreateThingInput) (req *request.Request, output *CreateThingOutput) {
op := &request.Operation{
Name: opCreateThing,
HTTPMethod: "POST",
HTTPPath: "/things/{thingName}",
}
if input == nil {
input = &CreateThingInput{}
}
output = &CreateThingOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateThing API operation for AWS IoT.
//
// Creates a thing record in the thing registry.
//
// 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 IoT's
// API operation CreateThing for usage and error information.
//
// Returned Error Codes:
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
// * ResourceAlreadyExistsException
// The resource already exists.
//
// * ResourceNotFoundException
// The specified resource does not exist.
//
func (c *IoT) CreateThing(input *CreateThingInput) (*CreateThingOutput, error) {
req, out := c.CreateThingRequest(input)
err := req.Send()
return out, err
}
const opCreateThingType = "CreateThingType"
// CreateThingTypeRequest generates a "aws/request.Request" representing the
// client's request for the CreateThingType operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateThingType for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateThingType method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateThingTypeRequest method.
// req, resp := client.CreateThingTypeRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreateThingTypeRequest(input *CreateThingTypeInput) (req *request.Request, output *CreateThingTypeOutput) {
op := &request.Operation{
Name: opCreateThingType,
HTTPMethod: "POST",
HTTPPath: "/thing-types/{thingTypeName}",
}
if input == nil {
input = &CreateThingTypeInput{}
}
output = &CreateThingTypeOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateThingType API operation for AWS IoT.
//
// Creates a new thing type.
//
// 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 IoT's
// API operation CreateThingType for usage and error information.
//
// Returned Error Codes:
// * InvalidRequestException
// The request is not valid.
//
// * ThrottlingException
// The rate exceeds the limit.
//
// * UnauthorizedException
// You are not authorized to perform this operation.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
// * InternalFailureException
// An unexpected error has occurred.
//
// * ResourceAlreadyExistsException
// The resource already exists.
//
func (c *IoT) CreateThingType(input *CreateThingTypeInput) (*CreateThingTypeOutput, error) {
req, out := c.CreateThingTypeRequest(input)
err := req.Send()
return out, err
}
const opCreateTopicRule = "CreateTopicRule"
// CreateTopicRuleRequest generates a "aws/request.Request" representing the
// client's request for the CreateTopicRule operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateTopicRule for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateTopicRule method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateTopicRuleRequest method.
// req, resp := client.CreateTopicRuleRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) CreateTopicRuleRequest(input *CreateTopicRuleInput) (req *request.Request, output *CreateTopicRuleOutput) {
op := &request.Operation{
Name: opCreateTopicRule,
HTTPMethod: "POST",
HTTPPath: "/rules/{ruleName}",
}
if input == nil {
input = &CreateTopicRuleInput{}
}
output = &CreateTopicRuleOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// CreateTopicRule API operation for AWS IoT.
//
// Creates a rule. Creating rules is an administrator-level action. Any user
// who has permission to create rules will be able to access data processed
// by the rule.
//
// 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 IoT's
// API operation CreateTopicRule for usage and error information.
//
// Returned Error Codes:
// * SqlParseException
// The Rule-SQL expression can't be parsed correctly.
//
// * InternalException
// An unexpected error has occurred.
//
// * InvalidRequestException
// The request is not valid.
//
// * ResourceAlreadyExistsException
// The resource already exists.
//
// * ServiceUnavailableException
// The service is temporarily unavailable.
//
func (c *IoT) CreateTopicRule(input *CreateTopicRuleInput) (*CreateTopicRuleOutput, error) {
req, out := c.CreateTopicRuleRequest(input)
err := req.Send()
return out, err
}
const opDeleteCACertificate = "DeleteCACertificate"
// DeleteCACertificateRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCACertificate operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DeleteCACertificate for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeleteCACertificate method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeleteCACertificateRequest method.
// req, resp := client.DeleteCACertificateRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
func (c *IoT) DeleteCACertificateRequest(input *DeleteCACertificateInput) (req *request.Request, output *DeleteCACertificateOutput) {
op := &request.Operation{
Name: opDeleteCACertificate,
HTTPMethod: "DELETE",
HTTPPath: "/cacertificate/{caCertificateId}",
}
if input == nil {
input = &DeleteCACertificateInput{}
}
output = &DeleteCACertificateOutput{}
req = c.newRequest(op, input, output)
return
}
// DeleteCACertificate API operation for AWS IoT.
//
// Deletes a registered CA certificate.
//
// 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.