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 MessagesCheckHistoryImportPeerRequest struct {
Peer InputPeerClass
}
const MessagesCheckHistoryImportPeerRequestTypeID = 0x5dc60f03
var (
_ bin .Encoder = &MessagesCheckHistoryImportPeerRequest {}
_ bin .Decoder = &MessagesCheckHistoryImportPeerRequest {}
_ bin .BareEncoder = &MessagesCheckHistoryImportPeerRequest {}
_ bin .BareDecoder = &MessagesCheckHistoryImportPeerRequest {}
)
func (c *MessagesCheckHistoryImportPeerRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Peer == nil ) {
return false
}
return true
}
func (c *MessagesCheckHistoryImportPeerRequest ) String () string {
if c == nil {
return "MessagesCheckHistoryImportPeerRequest(nil)"
}
type Alias MessagesCheckHistoryImportPeerRequest
return fmt .Sprintf ("MessagesCheckHistoryImportPeerRequest%+v" , Alias (*c ))
}
func (c *MessagesCheckHistoryImportPeerRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
}) {
c .Peer = from .GetPeer ()
}
func (*MessagesCheckHistoryImportPeerRequest ) TypeID () uint32 {
return MessagesCheckHistoryImportPeerRequestTypeID
}
func (*MessagesCheckHistoryImportPeerRequest ) TypeName () string {
return "messages.checkHistoryImportPeer"
}
func (c *MessagesCheckHistoryImportPeerRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.checkHistoryImportPeer" ,
ID : MessagesCheckHistoryImportPeerRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (c *MessagesCheckHistoryImportPeerRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkHistoryImportPeer#5dc60f03 as nil" )
}
b .PutID (MessagesCheckHistoryImportPeerRequestTypeID )
return c .EncodeBare (b )
}
func (c *MessagesCheckHistoryImportPeerRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkHistoryImportPeer#5dc60f03 as nil" )
}
if c .Peer == nil {
return fmt .Errorf ("unable to encode messages.checkHistoryImportPeer#5dc60f03: field peer is nil" )
}
if err := c .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.checkHistoryImportPeer#5dc60f03: field peer: %w" , err )
}
return nil
}
func (c *MessagesCheckHistoryImportPeerRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkHistoryImportPeer#5dc60f03 to nil" )
}
if err := b .ConsumeID (MessagesCheckHistoryImportPeerRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.checkHistoryImportPeer#5dc60f03: %w" , err )
}
return c .DecodeBare (b )
}
func (c *MessagesCheckHistoryImportPeerRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkHistoryImportPeer#5dc60f03 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.checkHistoryImportPeer#5dc60f03: field peer: %w" , err )
}
c .Peer = value
}
return nil
}
func (c *MessagesCheckHistoryImportPeerRequest ) GetPeer () (value InputPeerClass ) {
if c == nil {
return
}
return c .Peer
}
func (c *Client ) MessagesCheckHistoryImportPeer (ctx context .Context , peer InputPeerClass ) (*MessagesCheckedHistoryImportPeer , error ) {
var result MessagesCheckedHistoryImportPeer
request := &MessagesCheckHistoryImportPeerRequest {
Peer : peer ,
}
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 .