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 AuthFirebasePnvIntent struct {
Nonce string
DigitalCredentialPayload string
}
const AuthFirebasePnvIntentTypeID = 0xdf5ac00c
var (
_ bin .Encoder = &AuthFirebasePnvIntent {}
_ bin .Decoder = &AuthFirebasePnvIntent {}
_ bin .BareEncoder = &AuthFirebasePnvIntent {}
_ bin .BareDecoder = &AuthFirebasePnvIntent {}
)
func (f *AuthFirebasePnvIntent ) Zero () bool {
if f == nil {
return true
}
if !(f .Nonce == "" ) {
return false
}
if !(f .DigitalCredentialPayload == "" ) {
return false
}
return true
}
func (f *AuthFirebasePnvIntent ) String () string {
if f == nil {
return "AuthFirebasePnvIntent(nil)"
}
type Alias AuthFirebasePnvIntent
return fmt .Sprintf ("AuthFirebasePnvIntent%+v" , Alias (*f ))
}
func (f *AuthFirebasePnvIntent ) FillFrom (from interface {
GetNonce () (value string )
GetDigitalCredentialPayload () (value string )
}) {
f .Nonce = from .GetNonce ()
f .DigitalCredentialPayload = from .GetDigitalCredentialPayload ()
}
func (*AuthFirebasePnvIntent ) TypeID () uint32 {
return AuthFirebasePnvIntentTypeID
}
func (*AuthFirebasePnvIntent ) TypeName () string {
return "auth.firebasePnvIntent"
}
func (f *AuthFirebasePnvIntent ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "auth.firebasePnvIntent" ,
ID : AuthFirebasePnvIntentTypeID ,
}
if f == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Nonce" ,
SchemaName : "nonce" ,
},
{
Name : "DigitalCredentialPayload" ,
SchemaName : "digital_credential_payload" ,
},
}
return typ
}
func (f *AuthFirebasePnvIntent ) Encode (b *bin .Buffer ) error {
if f == nil {
return fmt .Errorf ("can't encode auth.firebasePnvIntent#df5ac00c as nil" )
}
b .PutID (AuthFirebasePnvIntentTypeID )
return f .EncodeBare (b )
}
func (f *AuthFirebasePnvIntent ) EncodeBare (b *bin .Buffer ) error {
if f == nil {
return fmt .Errorf ("can't encode auth.firebasePnvIntent#df5ac00c as nil" )
}
b .PutString (f .Nonce )
b .PutString (f .DigitalCredentialPayload )
return nil
}
func (f *AuthFirebasePnvIntent ) Decode (b *bin .Buffer ) error {
if f == nil {
return fmt .Errorf ("can't decode auth.firebasePnvIntent#df5ac00c to nil" )
}
if err := b .ConsumeID (AuthFirebasePnvIntentTypeID ); err != nil {
return fmt .Errorf ("unable to decode auth.firebasePnvIntent#df5ac00c: %w" , err )
}
return f .DecodeBare (b )
}
func (f *AuthFirebasePnvIntent ) DecodeBare (b *bin .Buffer ) error {
if f == nil {
return fmt .Errorf ("can't decode auth.firebasePnvIntent#df5ac00c to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode auth.firebasePnvIntent#df5ac00c: field nonce: %w" , err )
}
f .Nonce = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode auth.firebasePnvIntent#df5ac00c: field digital_credential_payload: %w" , err )
}
f .DigitalCredentialPayload = value
}
return nil
}
func (f *AuthFirebasePnvIntent ) GetNonce () (value string ) {
if f == nil {
return
}
return f .Nonce
}
func (f *AuthFirebasePnvIntent ) GetDigitalCredentialPayload () (value string ) {
if f == nil {
return
}
return f .DigitalCredentialPayload
}
The pages are generated with Golds v0.8.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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .