|
| 1 | +import 'dart:js_interop'; |
| 2 | + |
| 3 | +import 'response.dart'; |
| 4 | + |
| 5 | +// TODO: fix the extension type |
| 6 | +// - String? time |
| 7 | +// - Emails? emails |
| 8 | +// - String? UID -> fix the JS annotation |
| 9 | + |
| 10 | +/// The static interop class for the Gigya Reset Password API response. |
| 11 | +/// |
| 12 | +/// See also: https://help.sap.com/docs/SAP_CUSTOMER_DATA_CLOUD/8b8d6fffe113457094a17701f63e3d6a/c21d4e0445b84a779af1ad4868902c21.html#response-data |
| 13 | +@JS() |
| 14 | +@anonymous |
| 15 | +@staticInterop |
| 16 | +class ResetPasswordResponse extends Response {} |
| 17 | + |
| 18 | +/// This extension defines the static interop definition |
| 19 | +/// for the [ResetPasswordResponse] class. |
| 20 | +extension ResetPasswordResponseExtension on ResetPasswordResponse { |
| 21 | + @JS('emails') |
| 22 | + external Object? get _emails; |
| 23 | + |
| 24 | + /// The email addresses belonging to the user. |
| 25 | + Map<String, dynamic> get emails { |
| 26 | + if (_emails.isUndefinedOrNull) { |
| 27 | + return const <String, dynamic>{}; |
| 28 | + } |
| 29 | + |
| 30 | + return (dartify(_emails) as Map<Object?, Object?>).cast<String, dynamic>(); |
| 31 | + } |
| 32 | + |
| 33 | + /// The token that should be used for the password reset in the password reset email. |
| 34 | + /// |
| 35 | + /// This is null if the email is sent by the Gigya SDK. |
| 36 | + external String? get passwordResetToken; |
| 37 | + |
| 38 | + /// The secret question for the password reset. |
| 39 | + /// |
| 40 | + /// This is null if there is no security verification failure. |
| 41 | + external String? get secretQuestion; |
| 42 | + |
| 43 | + /// The UID of the user whose password was changed. |
| 44 | + /// |
| 45 | + /// This is null if the password was not changed yet. |
| 46 | + @JS('UID') |
| 47 | + external String? get uid; |
| 48 | +} |
0 commit comments