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 MessagesCheckHistoryImportRequest struct {
ImportHead string
}
const MessagesCheckHistoryImportRequestTypeID = 0x43fe19f3
var (
_ bin .Encoder = &MessagesCheckHistoryImportRequest {}
_ bin .Decoder = &MessagesCheckHistoryImportRequest {}
_ bin .BareEncoder = &MessagesCheckHistoryImportRequest {}
_ bin .BareDecoder = &MessagesCheckHistoryImportRequest {}
)
func (c *MessagesCheckHistoryImportRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .ImportHead == "" ) {
return false
}
return true
}
func (c *MessagesCheckHistoryImportRequest ) String () string {
if c == nil {
return "MessagesCheckHistoryImportRequest(nil)"
}
type Alias MessagesCheckHistoryImportRequest
return fmt .Sprintf ("MessagesCheckHistoryImportRequest%+v" , Alias (*c ))
}
func (c *MessagesCheckHistoryImportRequest ) FillFrom (from interface {
GetImportHead () (value string )
}) {
c .ImportHead = from .GetImportHead ()
}
func (*MessagesCheckHistoryImportRequest ) TypeID () uint32 {
return MessagesCheckHistoryImportRequestTypeID
}
func (*MessagesCheckHistoryImportRequest ) TypeName () string {
return "messages.checkHistoryImport"
}
func (c *MessagesCheckHistoryImportRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.checkHistoryImport" ,
ID : MessagesCheckHistoryImportRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ImportHead" ,
SchemaName : "import_head" ,
},
}
return typ
}
func (c *MessagesCheckHistoryImportRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkHistoryImport#43fe19f3 as nil" )
}
b .PutID (MessagesCheckHistoryImportRequestTypeID )
return c .EncodeBare (b )
}
func (c *MessagesCheckHistoryImportRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkHistoryImport#43fe19f3 as nil" )
}
b .PutString (c .ImportHead )
return nil
}
func (c *MessagesCheckHistoryImportRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkHistoryImport#43fe19f3 to nil" )
}
if err := b .ConsumeID (MessagesCheckHistoryImportRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.checkHistoryImport#43fe19f3: %w" , err )
}
return c .DecodeBare (b )
}
func (c *MessagesCheckHistoryImportRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkHistoryImport#43fe19f3 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.checkHistoryImport#43fe19f3: field import_head: %w" , err )
}
c .ImportHead = value
}
return nil
}
func (c *MessagesCheckHistoryImportRequest ) GetImportHead () (value string ) {
if c == nil {
return
}
return c .ImportHead
}
func (c *Client ) MessagesCheckHistoryImport (ctx context .Context , importhead string ) (*MessagesHistoryImportParsed , error ) {
var result MessagesHistoryImportParsed
request := &MessagesCheckHistoryImportRequest {
ImportHead : importhead ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , nil
}
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 .