-
Notifications
You must be signed in to change notification settings - Fork 102
/
passwordState.go
executable file
·41 lines (36 loc) · 2.55 KB
/
passwordState.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
// AUTOGENERATED - DO NOT EDIT
package tdlib
// PasswordState Represents the current state of 2-step verification
type PasswordState struct {
tdCommon
HasPassword bool `json:"has_password"` // True, if a 2-step verification password is set
PasswordHint string `json:"password_hint"` // Hint for the password; may be empty
HasRecoveryEmailAddress bool `json:"has_recovery_email_address"` // True, if a recovery email is set
HasPassportData bool `json:"has_passport_data"` // True, if some Telegram Passport elements were saved
RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"` // Information about the recovery email address to which the confirmation email was sent; may be null
PendingResetDate int32 `json:"pending_reset_date"` // If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
}
// MessageType return the string telegram-type of PasswordState
func (passwordState *PasswordState) MessageType() string {
return "passwordState"
}
// NewPasswordState creates a new PasswordState
//
// @param hasPassword True, if a 2-step verification password is set
// @param passwordHint Hint for the password; may be empty
// @param hasRecoveryEmailAddress True, if a recovery email is set
// @param hasPassportData True, if some Telegram Passport elements were saved
// @param recoveryEmailAddressCodeInfo Information about the recovery email address to which the confirmation email was sent; may be null
// @param pendingResetDate If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
func NewPasswordState(hasPassword bool, passwordHint string, hasRecoveryEmailAddress bool, hasPassportData bool, recoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo, pendingResetDate int32) *PasswordState {
passwordStateTemp := PasswordState{
tdCommon: tdCommon{Type: "passwordState"},
HasPassword: hasPassword,
PasswordHint: passwordHint,
HasRecoveryEmailAddress: hasRecoveryEmailAddress,
HasPassportData: hasPassportData,
RecoveryEmailAddressCodeInfo: recoveryEmailAddressCodeInfo,
PendingResetDate: pendingResetDate,
}
return &passwordStateTemp
}