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 WebViewResultURL struct {
QueryID int64
URL string
}
const WebViewResultURLTypeID = 0xc14557c
var (
_ bin .Encoder = &WebViewResultURL {}
_ bin .Decoder = &WebViewResultURL {}
_ bin .BareEncoder = &WebViewResultURL {}
_ bin .BareDecoder = &WebViewResultURL {}
)
func (w *WebViewResultURL ) Zero () bool {
if w == nil {
return true
}
if !(w .QueryID == 0 ) {
return false
}
if !(w .URL == "" ) {
return false
}
return true
}
func (w *WebViewResultURL ) String () string {
if w == nil {
return "WebViewResultURL(nil)"
}
type Alias WebViewResultURL
return fmt .Sprintf ("WebViewResultURL%+v" , Alias (*w ))
}
func (w *WebViewResultURL ) FillFrom (from interface {
GetQueryID () (value int64 )
GetURL () (value string )
}) {
w .QueryID = from .GetQueryID ()
w .URL = from .GetURL ()
}
func (*WebViewResultURL ) TypeID () uint32 {
return WebViewResultURLTypeID
}
func (*WebViewResultURL ) TypeName () string {
return "webViewResultUrl"
}
func (w *WebViewResultURL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "webViewResultUrl" ,
ID : WebViewResultURLTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "URL" ,
SchemaName : "url" ,
},
}
return typ
}
func (w *WebViewResultURL ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode webViewResultUrl#c14557c as nil" )
}
b .PutID (WebViewResultURLTypeID )
return w .EncodeBare (b )
}
func (w *WebViewResultURL ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode webViewResultUrl#c14557c as nil" )
}
b .PutLong (w .QueryID )
b .PutString (w .URL )
return nil
}
func (w *WebViewResultURL ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode webViewResultUrl#c14557c to nil" )
}
if err := b .ConsumeID (WebViewResultURLTypeID ); err != nil {
return fmt .Errorf ("unable to decode webViewResultUrl#c14557c: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WebViewResultURL ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode webViewResultUrl#c14557c to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode webViewResultUrl#c14557c: field query_id: %w" , err )
}
w .QueryID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode webViewResultUrl#c14557c: field url: %w" , err )
}
w .URL = value
}
return nil
}
func (w *WebViewResultURL ) GetQueryID () (value int64 ) {
if w == nil {
return
}
return w .QueryID
}
func (w *WebViewResultURL ) GetURL () (value string ) {
if w == nil {
return
}
return w .URL
}
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 .