-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
errors.go
328 lines (283 loc) · 15 KB
/
errors.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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cognitoidentityprovider
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeAliasExistsException for service response error code
// "AliasExistsException".
//
// This exception is thrown when a user tries to confirm the account with an
// email address or phone number that has already been supplied as an alias
// for a different user profile. This exception indicates that an account with
// this email address or phone already exists in a user pool that you've configured
// to use email address or phone number as a sign-in alias.
ErrCodeAliasExistsException = "AliasExistsException"
// ErrCodeCodeDeliveryFailureException for service response error code
// "CodeDeliveryFailureException".
//
// This exception is thrown when a verification code fails to deliver successfully.
ErrCodeCodeDeliveryFailureException = "CodeDeliveryFailureException"
// ErrCodeCodeMismatchException for service response error code
// "CodeMismatchException".
//
// This exception is thrown if the provided code doesn't match what the server
// was expecting.
ErrCodeCodeMismatchException = "CodeMismatchException"
// ErrCodeConcurrentModificationException for service response error code
// "ConcurrentModificationException".
//
// This exception is thrown if two or more modifications are happening concurrently.
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
// ErrCodeDuplicateProviderException for service response error code
// "DuplicateProviderException".
//
// This exception is thrown when the provider is already supported by the user
// pool.
ErrCodeDuplicateProviderException = "DuplicateProviderException"
// ErrCodeEnableSoftwareTokenMFAException for service response error code
// "EnableSoftwareTokenMFAException".
//
// This exception is thrown when there is a code mismatch and the service fails
// to configure the software token TOTP multi-factor authentication (MFA).
ErrCodeEnableSoftwareTokenMFAException = "EnableSoftwareTokenMFAException"
// ErrCodeExpiredCodeException for service response error code
// "ExpiredCodeException".
//
// This exception is thrown if a code has expired.
ErrCodeExpiredCodeException = "ExpiredCodeException"
// ErrCodeForbiddenException for service response error code
// "ForbiddenException".
//
// This exception is thrown when WAF doesn't allow your request based on a web
// ACL that's associated with your user pool.
ErrCodeForbiddenException = "ForbiddenException"
// ErrCodeGroupExistsException for service response error code
// "GroupExistsException".
//
// This exception is thrown when Amazon Cognito encounters a group that already
// exists in the user pool.
ErrCodeGroupExistsException = "GroupExistsException"
// ErrCodeInternalErrorException for service response error code
// "InternalErrorException".
//
// This exception is thrown when Amazon Cognito encounters an internal error.
ErrCodeInternalErrorException = "InternalErrorException"
// ErrCodeInvalidEmailRoleAccessPolicyException for service response error code
// "InvalidEmailRoleAccessPolicyException".
//
// This exception is thrown when Amazon Cognito isn't allowed to use your email
// identity. HTTP status code: 400.
ErrCodeInvalidEmailRoleAccessPolicyException = "InvalidEmailRoleAccessPolicyException"
// ErrCodeInvalidLambdaResponseException for service response error code
// "InvalidLambdaResponseException".
//
// This exception is thrown when Amazon Cognito encounters an invalid Lambda
// response.
ErrCodeInvalidLambdaResponseException = "InvalidLambdaResponseException"
// ErrCodeInvalidOAuthFlowException for service response error code
// "InvalidOAuthFlowException".
//
// This exception is thrown when the specified OAuth flow is not valid.
ErrCodeInvalidOAuthFlowException = "InvalidOAuthFlowException"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
//
// This exception is thrown when the Amazon Cognito service encounters an invalid
// parameter.
ErrCodeInvalidParameterException = "InvalidParameterException"
// ErrCodeInvalidPasswordException for service response error code
// "InvalidPasswordException".
//
// This exception is thrown when Amazon Cognito encounters an invalid password.
ErrCodeInvalidPasswordException = "InvalidPasswordException"
// ErrCodeInvalidSmsRoleAccessPolicyException for service response error code
// "InvalidSmsRoleAccessPolicyException".
//
// This exception is returned when the role provided for SMS configuration doesn't
// have permission to publish using Amazon SNS.
ErrCodeInvalidSmsRoleAccessPolicyException = "InvalidSmsRoleAccessPolicyException"
// ErrCodeInvalidSmsRoleTrustRelationshipException for service response error code
// "InvalidSmsRoleTrustRelationshipException".
//
// This exception is thrown when the trust relationship is not valid for the
// role provided for SMS configuration. This can happen if you don't 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.
ErrCodeInvalidSmsRoleTrustRelationshipException = "InvalidSmsRoleTrustRelationshipException"
// ErrCodeInvalidUserPoolConfigurationException for service response error code
// "InvalidUserPoolConfigurationException".
//
// This exception is thrown when the user pool configuration is not valid.
ErrCodeInvalidUserPoolConfigurationException = "InvalidUserPoolConfigurationException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// This exception is thrown when a user exceeds the limit for a requested Amazon
// Web Services resource.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeMFAMethodNotFoundException for service response error code
// "MFAMethodNotFoundException".
//
// This exception is thrown when Amazon Cognito can't find a multi-factor authentication
// (MFA) method.
ErrCodeMFAMethodNotFoundException = "MFAMethodNotFoundException"
// ErrCodeNotAuthorizedException for service response error code
// "NotAuthorizedException".
//
// This exception is thrown when a user isn't authorized.
ErrCodeNotAuthorizedException = "NotAuthorizedException"
// ErrCodePasswordResetRequiredException for service response error code
// "PasswordResetRequiredException".
//
// This exception is thrown when a password reset is required.
ErrCodePasswordResetRequiredException = "PasswordResetRequiredException"
// ErrCodePreconditionNotMetException for service response error code
// "PreconditionNotMetException".
//
// This exception is thrown when a precondition is not met.
ErrCodePreconditionNotMetException = "PreconditionNotMetException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// This exception is thrown when the Amazon Cognito service can't find the requested
// resource.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeScopeDoesNotExistException for service response error code
// "ScopeDoesNotExistException".
//
// This exception is thrown when the specified scope doesn't exist.
ErrCodeScopeDoesNotExistException = "ScopeDoesNotExistException"
// ErrCodeSoftwareTokenMFANotFoundException for service response error code
// "SoftwareTokenMFANotFoundException".
//
// This exception is thrown when the software token time-based one-time password
// (TOTP) multi-factor authentication (MFA) isn't activated for the user pool.
ErrCodeSoftwareTokenMFANotFoundException = "SoftwareTokenMFANotFoundException"
// ErrCodeTooManyFailedAttemptsException for service response error code
// "TooManyFailedAttemptsException".
//
// This exception is thrown when the user has made too many failed attempts
// for a given action, such as sign-in.
ErrCodeTooManyFailedAttemptsException = "TooManyFailedAttemptsException"
// ErrCodeTooManyRequestsException for service response error code
// "TooManyRequestsException".
//
// This exception is thrown when the user has made too many requests for a given
// operation.
ErrCodeTooManyRequestsException = "TooManyRequestsException"
// ErrCodeUnauthorizedException for service response error code
// "UnauthorizedException".
//
// Exception that is thrown when the request isn't authorized. This can happen
// due to an invalid access token in the request.
ErrCodeUnauthorizedException = "UnauthorizedException"
// ErrCodeUnexpectedLambdaException for service response error code
// "UnexpectedLambdaException".
//
// This exception is thrown when Amazon Cognito encounters an unexpected exception
// with Lambda.
ErrCodeUnexpectedLambdaException = "UnexpectedLambdaException"
// ErrCodeUnsupportedIdentityProviderException for service response error code
// "UnsupportedIdentityProviderException".
//
// This exception is thrown when the specified identifier isn't supported.
ErrCodeUnsupportedIdentityProviderException = "UnsupportedIdentityProviderException"
// ErrCodeUnsupportedOperationException for service response error code
// "UnsupportedOperationException".
//
// Exception that is thrown when you attempt to perform an operation that isn't
// enabled for the user pool client.
ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
// ErrCodeUnsupportedTokenTypeException for service response error code
// "UnsupportedTokenTypeException".
//
// Exception that is thrown when an unsupported token is passed to an operation.
ErrCodeUnsupportedTokenTypeException = "UnsupportedTokenTypeException"
// ErrCodeUnsupportedUserStateException for service response error code
// "UnsupportedUserStateException".
//
// The request failed because the user is in an unsupported state.
ErrCodeUnsupportedUserStateException = "UnsupportedUserStateException"
// ErrCodeUserImportInProgressException for service response error code
// "UserImportInProgressException".
//
// This exception is thrown when you're trying to modify a user pool while a
// user import job is in progress for that pool.
ErrCodeUserImportInProgressException = "UserImportInProgressException"
// ErrCodeUserLambdaValidationException for service response error code
// "UserLambdaValidationException".
//
// This exception is thrown when the Amazon Cognito service encounters a user
// validation exception with the Lambda service.
ErrCodeUserLambdaValidationException = "UserLambdaValidationException"
// ErrCodeUserNotConfirmedException for service response error code
// "UserNotConfirmedException".
//
// This exception is thrown when a user isn't confirmed successfully.
ErrCodeUserNotConfirmedException = "UserNotConfirmedException"
// ErrCodeUserNotFoundException for service response error code
// "UserNotFoundException".
//
// This exception is thrown when a user isn't found.
ErrCodeUserNotFoundException = "UserNotFoundException"
// ErrCodeUserPoolAddOnNotEnabledException for service response error code
// "UserPoolAddOnNotEnabledException".
//
// This exception is thrown when user pool add-ons aren't enabled.
ErrCodeUserPoolAddOnNotEnabledException = "UserPoolAddOnNotEnabledException"
// ErrCodeUserPoolTaggingException for service response error code
// "UserPoolTaggingException".
//
// This exception is thrown when a user pool tag can't be set or updated.
ErrCodeUserPoolTaggingException = "UserPoolTaggingException"
// ErrCodeUsernameExistsException for service response error code
// "UsernameExistsException".
//
// This exception is thrown when Amazon Cognito encounters a user name that
// already exists in the user pool.
ErrCodeUsernameExistsException = "UsernameExistsException"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"AliasExistsException": newErrorAliasExistsException,
"CodeDeliveryFailureException": newErrorCodeDeliveryFailureException,
"CodeMismatchException": newErrorCodeMismatchException,
"ConcurrentModificationException": newErrorConcurrentModificationException,
"DuplicateProviderException": newErrorDuplicateProviderException,
"EnableSoftwareTokenMFAException": newErrorEnableSoftwareTokenMFAException,
"ExpiredCodeException": newErrorExpiredCodeException,
"ForbiddenException": newErrorForbiddenException,
"GroupExistsException": newErrorGroupExistsException,
"InternalErrorException": newErrorInternalErrorException,
"InvalidEmailRoleAccessPolicyException": newErrorInvalidEmailRoleAccessPolicyException,
"InvalidLambdaResponseException": newErrorInvalidLambdaResponseException,
"InvalidOAuthFlowException": newErrorInvalidOAuthFlowException,
"InvalidParameterException": newErrorInvalidParameterException,
"InvalidPasswordException": newErrorInvalidPasswordException,
"InvalidSmsRoleAccessPolicyException": newErrorInvalidSmsRoleAccessPolicyException,
"InvalidSmsRoleTrustRelationshipException": newErrorInvalidSmsRoleTrustRelationshipException,
"InvalidUserPoolConfigurationException": newErrorInvalidUserPoolConfigurationException,
"LimitExceededException": newErrorLimitExceededException,
"MFAMethodNotFoundException": newErrorMFAMethodNotFoundException,
"NotAuthorizedException": newErrorNotAuthorizedException,
"PasswordResetRequiredException": newErrorPasswordResetRequiredException,
"PreconditionNotMetException": newErrorPreconditionNotMetException,
"ResourceNotFoundException": newErrorResourceNotFoundException,
"ScopeDoesNotExistException": newErrorScopeDoesNotExistException,
"SoftwareTokenMFANotFoundException": newErrorSoftwareTokenMFANotFoundException,
"TooManyFailedAttemptsException": newErrorTooManyFailedAttemptsException,
"TooManyRequestsException": newErrorTooManyRequestsException,
"UnauthorizedException": newErrorUnauthorizedException,
"UnexpectedLambdaException": newErrorUnexpectedLambdaException,
"UnsupportedIdentityProviderException": newErrorUnsupportedIdentityProviderException,
"UnsupportedOperationException": newErrorUnsupportedOperationException,
"UnsupportedTokenTypeException": newErrorUnsupportedTokenTypeException,
"UnsupportedUserStateException": newErrorUnsupportedUserStateException,
"UserImportInProgressException": newErrorUserImportInProgressException,
"UserLambdaValidationException": newErrorUserLambdaValidationException,
"UserNotConfirmedException": newErrorUserNotConfirmedException,
"UserNotFoundException": newErrorUserNotFoundException,
"UserPoolAddOnNotEnabledException": newErrorUserPoolAddOnNotEnabledException,
"UserPoolTaggingException": newErrorUserPoolTaggingException,
"UsernameExistsException": newErrorUsernameExistsException,
}