package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type InputCheckPasswordEmpty struct {
}
const InputCheckPasswordEmptyTypeID = 0x9880f658
func (i InputCheckPasswordEmpty ) construct () InputCheckPasswordSRPClass { return &i }
var (
_ bin .Encoder = &InputCheckPasswordEmpty {}
_ bin .Decoder = &InputCheckPasswordEmpty {}
_ bin .BareEncoder = &InputCheckPasswordEmpty {}
_ bin .BareDecoder = &InputCheckPasswordEmpty {}
_ InputCheckPasswordSRPClass = &InputCheckPasswordEmpty {}
)
func (i *InputCheckPasswordEmpty ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputCheckPasswordEmpty ) String () string {
if i == nil {
return "InputCheckPasswordEmpty(nil)"
}
type Alias InputCheckPasswordEmpty
return fmt .Sprintf ("InputCheckPasswordEmpty%+v" , Alias (*i ))
}
func (*InputCheckPasswordEmpty ) TypeID () uint32 {
return InputCheckPasswordEmptyTypeID
}
func (*InputCheckPasswordEmpty ) TypeName () string {
return "inputCheckPasswordEmpty"
}
func (i *InputCheckPasswordEmpty ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputCheckPasswordEmpty" ,
ID : InputCheckPasswordEmptyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputCheckPasswordEmpty ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputCheckPasswordEmpty#9880f658 as nil" )
}
b .PutID (InputCheckPasswordEmptyTypeID )
return i .EncodeBare (b )
}
func (i *InputCheckPasswordEmpty ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputCheckPasswordEmpty#9880f658 as nil" )
}
return nil
}
func (i *InputCheckPasswordEmpty ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputCheckPasswordEmpty#9880f658 to nil" )
}
if err := b .ConsumeID (InputCheckPasswordEmptyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputCheckPasswordEmpty#9880f658: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputCheckPasswordEmpty ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputCheckPasswordEmpty#9880f658 to nil" )
}
return nil
}
type InputCheckPasswordSRP struct {
SRPID int64
A []byte
M1 []byte
}
const InputCheckPasswordSRPTypeID = 0xd27ff082
func (i InputCheckPasswordSRP ) construct () InputCheckPasswordSRPClass { return &i }
var (
_ bin .Encoder = &InputCheckPasswordSRP {}
_ bin .Decoder = &InputCheckPasswordSRP {}
_ bin .BareEncoder = &InputCheckPasswordSRP {}
_ bin .BareDecoder = &InputCheckPasswordSRP {}
_ InputCheckPasswordSRPClass = &InputCheckPasswordSRP {}
)
func (i *InputCheckPasswordSRP ) Zero () bool {
if i == nil {
return true
}
if !(i .SRPID == 0 ) {
return false
}
if !(i .A == nil ) {
return false
}
if !(i .M1 == nil ) {
return false
}
return true
}
func (i *InputCheckPasswordSRP ) String () string {
if i == nil {
return "InputCheckPasswordSRP(nil)"
}
type Alias InputCheckPasswordSRP
return fmt .Sprintf ("InputCheckPasswordSRP%+v" , Alias (*i ))
}
func (i *InputCheckPasswordSRP ) FillFrom (from interface {
GetSRPID () (value int64 )
GetA () (value []byte )
GetM1 () (value []byte )
}) {
i .SRPID = from .GetSRPID ()
i .A = from .GetA ()
i .M1 = from .GetM1 ()
}
func (*InputCheckPasswordSRP ) TypeID () uint32 {
return InputCheckPasswordSRPTypeID
}
func (*InputCheckPasswordSRP ) TypeName () string {
return "inputCheckPasswordSRP"
}
func (i *InputCheckPasswordSRP ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputCheckPasswordSRP" ,
ID : InputCheckPasswordSRPTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "SRPID" ,
SchemaName : "srp_id" ,
},
{
Name : "A" ,
SchemaName : "A" ,
},
{
Name : "M1" ,
SchemaName : "M1" ,
},
}
return typ
}
func (i *InputCheckPasswordSRP ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputCheckPasswordSRP#d27ff082 as nil" )
}
b .PutID (InputCheckPasswordSRPTypeID )
return i .EncodeBare (b )
}
func (i *InputCheckPasswordSRP ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputCheckPasswordSRP#d27ff082 as nil" )
}
b .PutLong (i .SRPID )
b .PutBytes (i .A )
b .PutBytes (i .M1 )
return nil
}
func (i *InputCheckPasswordSRP ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputCheckPasswordSRP#d27ff082 to nil" )
}
if err := b .ConsumeID (InputCheckPasswordSRPTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputCheckPasswordSRP#d27ff082: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputCheckPasswordSRP ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputCheckPasswordSRP#d27ff082 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputCheckPasswordSRP#d27ff082: field srp_id: %w" , err )
}
i .SRPID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputCheckPasswordSRP#d27ff082: field A: %w" , err )
}
i .A = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode inputCheckPasswordSRP#d27ff082: field M1: %w" , err )
}
i .M1 = value
}
return nil
}
func (i *InputCheckPasswordSRP ) GetSRPID () (value int64 ) {
if i == nil {
return
}
return i .SRPID
}
func (i *InputCheckPasswordSRP ) GetA () (value []byte ) {
if i == nil {
return
}
return i .A
}
func (i *InputCheckPasswordSRP ) GetM1 () (value []byte ) {
if i == nil {
return
}
return i .M1
}
const InputCheckPasswordSRPClassName = "InputCheckPasswordSRP"
type InputCheckPasswordSRPClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputCheckPasswordSRPClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
AsNotEmpty () (*InputCheckPasswordSRP , bool )
}
func (i *InputCheckPasswordEmpty ) AsNotEmpty () (*InputCheckPasswordSRP , bool ) {
return nil , false
}
func (i *InputCheckPasswordSRP ) AsNotEmpty () (*InputCheckPasswordSRP , bool ) {
return i , true
}
func DecodeInputCheckPasswordSRP (buf *bin .Buffer ) (InputCheckPasswordSRPClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputCheckPasswordEmptyTypeID :
v := InputCheckPasswordEmpty {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputCheckPasswordSRPClass: %w" , err )
}
return &v , nil
case InputCheckPasswordSRPTypeID :
v := InputCheckPasswordSRP {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputCheckPasswordSRPClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputCheckPasswordSRPClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputCheckPasswordSRPBox struct {
InputCheckPasswordSRP InputCheckPasswordSRPClass
}
func (b *InputCheckPasswordSRPBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputCheckPasswordSRPBox to nil" )
}
v , err := DecodeInputCheckPasswordSRP (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputCheckPasswordSRP = v
return nil
}
func (b *InputCheckPasswordSRPBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputCheckPasswordSRP == nil {
return fmt .Errorf ("unable to encode InputCheckPasswordSRPClass as nil" )
}
return b .InputCheckPasswordSRP .Encode (buf )
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .