package mt
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 HTTPWaitRequest struct {
MaxDelay int
WaitAfter int
MaxWait int
}
const HTTPWaitRequestTypeID = 0x9299359f
var (
_ bin .Encoder = &HTTPWaitRequest {}
_ bin .Decoder = &HTTPWaitRequest {}
_ bin .BareEncoder = &HTTPWaitRequest {}
_ bin .BareDecoder = &HTTPWaitRequest {}
)
func (h *HTTPWaitRequest ) Zero () bool {
if h == nil {
return true
}
if !(h .MaxDelay == 0 ) {
return false
}
if !(h .WaitAfter == 0 ) {
return false
}
if !(h .MaxWait == 0 ) {
return false
}
return true
}
func (h *HTTPWaitRequest ) String () string {
if h == nil {
return "HTTPWaitRequest(nil)"
}
type Alias HTTPWaitRequest
return fmt .Sprintf ("HTTPWaitRequest%+v" , Alias (*h ))
}
func (*HTTPWaitRequest ) TypeID () uint32 {
return HTTPWaitRequestTypeID
}
func (*HTTPWaitRequest ) TypeName () string {
return "http_wait"
}
func (h *HTTPWaitRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "http_wait" ,
ID : HTTPWaitRequestTypeID ,
}
if h == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MaxDelay" ,
SchemaName : "max_delay" ,
},
{
Name : "WaitAfter" ,
SchemaName : "wait_after" ,
},
{
Name : "MaxWait" ,
SchemaName : "max_wait" ,
},
}
return typ
}
func (h *HTTPWaitRequest ) Encode (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't encode http_wait#9299359f as nil" )
}
b .PutID (HTTPWaitRequestTypeID )
return h .EncodeBare (b )
}
func (h *HTTPWaitRequest ) EncodeBare (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't encode http_wait#9299359f as nil" )
}
b .PutInt (h .MaxDelay )
b .PutInt (h .WaitAfter )
b .PutInt (h .MaxWait )
return nil
}
func (h *HTTPWaitRequest ) Decode (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't decode http_wait#9299359f to nil" )
}
if err := b .ConsumeID (HTTPWaitRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode http_wait#9299359f: %w" , err )
}
return h .DecodeBare (b )
}
func (h *HTTPWaitRequest ) DecodeBare (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't decode http_wait#9299359f to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode http_wait#9299359f: field max_delay: %w" , err )
}
h .MaxDelay = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode http_wait#9299359f: field wait_after: %w" , err )
}
h .WaitAfter = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode http_wait#9299359f: field max_wait: %w" , err )
}
h .MaxWait = value
}
return nil
}
func (h *HTTPWaitRequest ) GetMaxDelay () (value int ) {
if h == nil {
return
}
return h .MaxDelay
}
func (h *HTTPWaitRequest ) GetWaitAfter () (value int ) {
if h == nil {
return
}
return h .WaitAfter
}
func (h *HTTPWaitRequest ) GetMaxWait () (value int ) {
if h == nil {
return
}
return h .MaxWait
}
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 .