forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
24419 lines (21380 loc) · 855 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 cognitoidentityprovider
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opAddCustomAttributes = "AddCustomAttributes"
// AddCustomAttributesRequest generates a "aws/request.Request" representing the
// client's request for the AddCustomAttributes operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AddCustomAttributes for more information on using the AddCustomAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AddCustomAttributesRequest method.
// req, resp := client.AddCustomAttributesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes
func (c *CognitoIdentityProvider) AddCustomAttributesRequest(input *AddCustomAttributesInput) (req *request.Request, output *AddCustomAttributesOutput) {
op := &request.Operation{
Name: opAddCustomAttributes,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddCustomAttributesInput{}
}
output = &AddCustomAttributesOutput{}
req = c.newRequest(op, input, output)
return
}
// AddCustomAttributes API operation for Amazon Cognito Identity Provider.
//
// Adds additional user attributes to the user pool schema.
//
// 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 Amazon Cognito Identity Provider's
// API operation AddCustomAttributes for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserImportInProgressException "UserImportInProgressException"
// This exception is thrown when you are trying to modify a user pool while
// a user import job is in progress for that pool.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes
func (c *CognitoIdentityProvider) AddCustomAttributes(input *AddCustomAttributesInput) (*AddCustomAttributesOutput, error) {
req, out := c.AddCustomAttributesRequest(input)
return out, req.Send()
}
// AddCustomAttributesWithContext is the same as AddCustomAttributes with the addition of
// the ability to pass a context and additional request options.
//
// See AddCustomAttributes for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AddCustomAttributesWithContext(ctx aws.Context, input *AddCustomAttributesInput, opts ...request.Option) (*AddCustomAttributesOutput, error) {
req, out := c.AddCustomAttributesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminAddUserToGroup = "AdminAddUserToGroup"
// AdminAddUserToGroupRequest generates a "aws/request.Request" representing the
// client's request for the AdminAddUserToGroup operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminAddUserToGroup for more information on using the AdminAddUserToGroup
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminAddUserToGroupRequest method.
// req, resp := client.AdminAddUserToGroupRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup
func (c *CognitoIdentityProvider) AdminAddUserToGroupRequest(input *AdminAddUserToGroupInput) (req *request.Request, output *AdminAddUserToGroupOutput) {
op := &request.Operation{
Name: opAdminAddUserToGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminAddUserToGroupInput{}
}
output = &AdminAddUserToGroupOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AdminAddUserToGroup API operation for Amazon Cognito Identity Provider.
//
// Adds the specified user to the specified group.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminAddUserToGroup for usage and error information.
//
// Returned Error Codes:
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup
func (c *CognitoIdentityProvider) AdminAddUserToGroup(input *AdminAddUserToGroupInput) (*AdminAddUserToGroupOutput, error) {
req, out := c.AdminAddUserToGroupRequest(input)
return out, req.Send()
}
// AdminAddUserToGroupWithContext is the same as AdminAddUserToGroup with the addition of
// the ability to pass a context and additional request options.
//
// See AdminAddUserToGroup for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminAddUserToGroupWithContext(ctx aws.Context, input *AdminAddUserToGroupInput, opts ...request.Option) (*AdminAddUserToGroupOutput, error) {
req, out := c.AdminAddUserToGroupRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminConfirmSignUp = "AdminConfirmSignUp"
// AdminConfirmSignUpRequest generates a "aws/request.Request" representing the
// client's request for the AdminConfirmSignUp operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminConfirmSignUp for more information on using the AdminConfirmSignUp
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminConfirmSignUpRequest method.
// req, resp := client.AdminConfirmSignUpRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp
func (c *CognitoIdentityProvider) AdminConfirmSignUpRequest(input *AdminConfirmSignUpInput) (req *request.Request, output *AdminConfirmSignUpOutput) {
op := &request.Operation{
Name: opAdminConfirmSignUp,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminConfirmSignUpInput{}
}
output = &AdminConfirmSignUpOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminConfirmSignUp API operation for Amazon Cognito Identity Provider.
//
// Confirms user registration as an admin without using a confirmation code.
// Works on any user.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminConfirmSignUp for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException"
// This exception is thrown when the Amazon Cognito service encounters an unexpected
// exception with the AWS Lambda service.
//
// * ErrCodeUserLambdaValidationException "UserLambdaValidationException"
// This exception is thrown when the Amazon Cognito service encounters a user
// validation exception with the AWS Lambda service.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeTooManyFailedAttemptsException "TooManyFailedAttemptsException"
// This exception is thrown when the user has made too many failed attempts
// for a given action (e.g., sign in).
//
// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// AWS Lambda response.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeLimitExceededException "LimitExceededException"
// This exception is thrown when a user exceeds the limit for a requested AWS
// resource.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp
func (c *CognitoIdentityProvider) AdminConfirmSignUp(input *AdminConfirmSignUpInput) (*AdminConfirmSignUpOutput, error) {
req, out := c.AdminConfirmSignUpRequest(input)
return out, req.Send()
}
// AdminConfirmSignUpWithContext is the same as AdminConfirmSignUp with the addition of
// the ability to pass a context and additional request options.
//
// See AdminConfirmSignUp for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminConfirmSignUpWithContext(ctx aws.Context, input *AdminConfirmSignUpInput, opts ...request.Option) (*AdminConfirmSignUpOutput, error) {
req, out := c.AdminConfirmSignUpRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminCreateUser = "AdminCreateUser"
// AdminCreateUserRequest generates a "aws/request.Request" representing the
// client's request for the AdminCreateUser operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminCreateUser for more information on using the AdminCreateUser
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminCreateUserRequest method.
// req, resp := client.AdminCreateUserRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser
func (c *CognitoIdentityProvider) AdminCreateUserRequest(input *AdminCreateUserInput) (req *request.Request, output *AdminCreateUserOutput) {
op := &request.Operation{
Name: opAdminCreateUser,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminCreateUserInput{}
}
output = &AdminCreateUserOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminCreateUser API operation for Amazon Cognito Identity Provider.
//
// Creates a new user in the specified user pool.
//
// If MessageAction is not set, the default is to send a welcome message via
// email or phone (SMS).
//
// This message is based on a template that you configured in your call to or
// . This template includes your custom sign-up instructions and placeholders
// for user name and temporary password.
//
// Alternatively, you can call AdminCreateUser with “SUPPRESS” for the MessageAction
// parameter, and Amazon Cognito will not send any email.
//
// In either case, the user will be in the FORCE_CHANGE_PASSWORD state until
// they sign in and change their password.
//
// AdminCreateUser requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminCreateUser for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeUsernameExistsException "UsernameExistsException"
// This exception is thrown when Amazon Cognito encounters a user name that
// already exists in the user pool.
//
// * ErrCodeInvalidPasswordException "InvalidPasswordException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// password.
//
// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException"
// This exception is thrown when a verification code fails to deliver successfully.
//
// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException"
// This exception is thrown when the Amazon Cognito service encounters an unexpected
// exception with the AWS Lambda service.
//
// * ErrCodeUserLambdaValidationException "UserLambdaValidationException"
// This exception is thrown when the Amazon Cognito service encounters a user
// validation exception with the AWS Lambda service.
//
// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// AWS Lambda response.
//
// * ErrCodePreconditionNotMetException "PreconditionNotMetException"
// This exception is thrown when a precondition is not met.
//
// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException"
// This exception is returned when the role provided for SMS configuration does
// not have permission to publish using Amazon SNS.
//
// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException"
// This exception is thrown when the trust relationship is invalid for the role
// provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com
// or the external ID provided in the role does not match what is provided in
// the SMS configuration for the user pool.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUnsupportedUserStateException "UnsupportedUserStateException"
// The request failed because the user is in an unsupported state.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser
func (c *CognitoIdentityProvider) AdminCreateUser(input *AdminCreateUserInput) (*AdminCreateUserOutput, error) {
req, out := c.AdminCreateUserRequest(input)
return out, req.Send()
}
// AdminCreateUserWithContext is the same as AdminCreateUser with the addition of
// the ability to pass a context and additional request options.
//
// See AdminCreateUser for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminCreateUserWithContext(ctx aws.Context, input *AdminCreateUserInput, opts ...request.Option) (*AdminCreateUserOutput, error) {
req, out := c.AdminCreateUserRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminDeleteUser = "AdminDeleteUser"
// AdminDeleteUserRequest generates a "aws/request.Request" representing the
// client's request for the AdminDeleteUser operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminDeleteUser for more information on using the AdminDeleteUser
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminDeleteUserRequest method.
// req, resp := client.AdminDeleteUserRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser
func (c *CognitoIdentityProvider) AdminDeleteUserRequest(input *AdminDeleteUserInput) (req *request.Request, output *AdminDeleteUserOutput) {
op := &request.Operation{
Name: opAdminDeleteUser,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminDeleteUserInput{}
}
output = &AdminDeleteUserOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AdminDeleteUser API operation for Amazon Cognito Identity Provider.
//
// Deletes a user as an administrator. Works on any user.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminDeleteUser for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser
func (c *CognitoIdentityProvider) AdminDeleteUser(input *AdminDeleteUserInput) (*AdminDeleteUserOutput, error) {
req, out := c.AdminDeleteUserRequest(input)
return out, req.Send()
}
// AdminDeleteUserWithContext is the same as AdminDeleteUser with the addition of
// the ability to pass a context and additional request options.
//
// See AdminDeleteUser for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminDeleteUserWithContext(ctx aws.Context, input *AdminDeleteUserInput, opts ...request.Option) (*AdminDeleteUserOutput, error) {
req, out := c.AdminDeleteUserRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminDeleteUserAttributes = "AdminDeleteUserAttributes"
// AdminDeleteUserAttributesRequest generates a "aws/request.Request" representing the
// client's request for the AdminDeleteUserAttributes operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminDeleteUserAttributes for more information on using the AdminDeleteUserAttributes
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminDeleteUserAttributesRequest method.
// req, resp := client.AdminDeleteUserAttributesRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes
func (c *CognitoIdentityProvider) AdminDeleteUserAttributesRequest(input *AdminDeleteUserAttributesInput) (req *request.Request, output *AdminDeleteUserAttributesOutput) {
op := &request.Operation{
Name: opAdminDeleteUserAttributes,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminDeleteUserAttributesInput{}
}
output = &AdminDeleteUserAttributesOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminDeleteUserAttributes API operation for Amazon Cognito Identity Provider.
//
// Deletes the user attributes in a user pool as an administrator. Works on
// any user.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminDeleteUserAttributes for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes
func (c *CognitoIdentityProvider) AdminDeleteUserAttributes(input *AdminDeleteUserAttributesInput) (*AdminDeleteUserAttributesOutput, error) {
req, out := c.AdminDeleteUserAttributesRequest(input)
return out, req.Send()
}
// AdminDeleteUserAttributesWithContext is the same as AdminDeleteUserAttributes with the addition of
// the ability to pass a context and additional request options.
//
// See AdminDeleteUserAttributes for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminDeleteUserAttributesWithContext(ctx aws.Context, input *AdminDeleteUserAttributesInput, opts ...request.Option) (*AdminDeleteUserAttributesOutput, error) {
req, out := c.AdminDeleteUserAttributesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminDisableProviderForUser = "AdminDisableProviderForUser"
// AdminDisableProviderForUserRequest generates a "aws/request.Request" representing the
// client's request for the AdminDisableProviderForUser operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminDisableProviderForUser for more information on using the AdminDisableProviderForUser
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminDisableProviderForUserRequest method.
// req, resp := client.AdminDisableProviderForUserRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser
func (c *CognitoIdentityProvider) AdminDisableProviderForUserRequest(input *AdminDisableProviderForUserInput) (req *request.Request, output *AdminDisableProviderForUserOutput) {
op := &request.Operation{
Name: opAdminDisableProviderForUser,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminDisableProviderForUserInput{}
}
output = &AdminDisableProviderForUserOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminDisableProviderForUser API operation for Amazon Cognito Identity Provider.
//
// Disables the user from signing in with the specified external (SAML or social)
// identity provider. If the user to disable is a Cognito User Pools native
// username + password user, they are not permitted to use their password to
// sign-in. If the user to disable is a linked external IdP user, any link between
// that user and an existing user is removed. The next time the external user
// (no longer attached to the previously linked DestinationUser) signs in, they
// must create a new user account. See .
//
// This action is enabled only for admin access and requires developer credentials.
//
// The ProviderName must match the value specified when creating an IdP for
// the pool.
//
// To disable a native username + password user, the ProviderName value must
// be Cognito and the ProviderAttributeName must be Cognito_Subject, with the
// ProviderAttributeValue being the name that is used in the user pool for the
// user.
//
// The ProviderAttributeName must always be Cognito_Subject for social identity
// providers. The ProviderAttributeValue must always be the exact subject that
// was used when the user was originally linked as a source user.
//
// For de-linking a SAML identity, there are two scenarios. If the linked identity
// has not yet been used to sign-in, the ProviderAttributeName and ProviderAttributeValue
// must be the same values that were used for the SourceUser when the identities
// were originally linked in the call. (If the linking was done with ProviderAttributeName
// set to Cognito_Subject, the same applies here). However, if the user has
// already signed in, the ProviderAttributeName must be Cognito_Subject and
// ProviderAttributeValue must be the subject of the SAML assertion.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminDisableProviderForUser for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeAliasExistsException "AliasExistsException"
// This exception is thrown when a user tries to confirm the account with an
// email or phone number that has already been supplied as an alias from a different
// account. This exception tells user that an account with this email or phone
// already exists.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser
func (c *CognitoIdentityProvider) AdminDisableProviderForUser(input *AdminDisableProviderForUserInput) (*AdminDisableProviderForUserOutput, error) {
req, out := c.AdminDisableProviderForUserRequest(input)
return out, req.Send()
}
// AdminDisableProviderForUserWithContext is the same as AdminDisableProviderForUser with the addition of
// the ability to pass a context and additional request options.
//
// See AdminDisableProviderForUser for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminDisableProviderForUserWithContext(ctx aws.Context, input *AdminDisableProviderForUserInput, opts ...request.Option) (*AdminDisableProviderForUserOutput, error) {
req, out := c.AdminDisableProviderForUserRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminDisableUser = "AdminDisableUser"
// AdminDisableUserRequest generates a "aws/request.Request" representing the
// client's request for the AdminDisableUser operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminDisableUser for more information on using the AdminDisableUser
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminDisableUserRequest method.
// req, resp := client.AdminDisableUserRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser
func (c *CognitoIdentityProvider) AdminDisableUserRequest(input *AdminDisableUserInput) (req *request.Request, output *AdminDisableUserOutput) {
op := &request.Operation{
Name: opAdminDisableUser,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminDisableUserInput{}
}
output = &AdminDisableUserOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminDisableUser API operation for Amazon Cognito Identity Provider.
//
// Disables the specified user as an administrator. Works on any user.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminDisableUser for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser
func (c *CognitoIdentityProvider) AdminDisableUser(input *AdminDisableUserInput) (*AdminDisableUserOutput, error) {
req, out := c.AdminDisableUserRequest(input)
return out, req.Send()
}
// AdminDisableUserWithContext is the same as AdminDisableUser with the addition of
// the ability to pass a context and additional request options.
//
// See AdminDisableUser for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CognitoIdentityProvider) AdminDisableUserWithContext(ctx aws.Context, input *AdminDisableUserInput, opts ...request.Option) (*AdminDisableUserOutput, error) {
req, out := c.AdminDisableUserRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAdminEnableUser = "AdminEnableUser"
// AdminEnableUserRequest generates a "aws/request.Request" representing the
// client's request for the AdminEnableUser operation. The "output" return
// value will be populated with the request's response once the request complets
// successfuly.
//
// Use "Send" method on the returned Request to send the API call to the service.
// the "output" return value is not valid until after Send returns without error.
//
// See AdminEnableUser for more information on using the AdminEnableUser
// API call, and error handling.
//
// This method is useful when you want to inject custom logic or configuration
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
//
//
// // Example sending a request using the AdminEnableUserRequest method.
// req, resp := client.AdminEnableUserRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser
func (c *CognitoIdentityProvider) AdminEnableUserRequest(input *AdminEnableUserInput) (req *request.Request, output *AdminEnableUserOutput) {
op := &request.Operation{
Name: opAdminEnableUser,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AdminEnableUserInput{}
}
output = &AdminEnableUserOutput{}
req = c.newRequest(op, input, output)
return
}
// AdminEnableUser API operation for Amazon Cognito Identity Provider.
//
// Enables the specified user as an administrator. Works on any user.
//
// Requires developer credentials.
//
// 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 Amazon Cognito Identity Provider's
// API operation AdminEnableUser for usage and error information.
//
// Returned Error Codes:
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// This exception is thrown when the Amazon Cognito service cannot find the
// requested resource.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// This exception is thrown when the user has made too many requests for a given
// operation.
//
// * ErrCodeNotAuthorizedException "NotAuthorizedException"
// This exception is thrown when a user is not authorized.
//
// * ErrCodeUserNotFoundException "UserNotFoundException"
// This exception is thrown when a user is not found.
//
// * ErrCodeInternalErrorException "InternalErrorException"
// This exception is thrown when Amazon Cognito encounters an internal error.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser
func (c *CognitoIdentityProvider) AdminEnableUser(input *AdminEnableUserInput) (*AdminEnableUserOutput, error) {
req, out := c.AdminEnableUserRequest(input)
return out, req.Send()
}