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 MessagesSendScreenshotNotificationRequest struct {
Peer InputPeerClass
ReplyTo InputReplyToClass
RandomID int64
}
const MessagesSendScreenshotNotificationRequestTypeID = 0xa1405817
var (
_ bin .Encoder = &MessagesSendScreenshotNotificationRequest {}
_ bin .Decoder = &MessagesSendScreenshotNotificationRequest {}
_ bin .BareEncoder = &MessagesSendScreenshotNotificationRequest {}
_ bin .BareDecoder = &MessagesSendScreenshotNotificationRequest {}
)
func (s *MessagesSendScreenshotNotificationRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .Peer == nil ) {
return false
}
if !(s .ReplyTo == nil ) {
return false
}
if !(s .RandomID == 0 ) {
return false
}
return true
}
func (s *MessagesSendScreenshotNotificationRequest ) String () string {
if s == nil {
return "MessagesSendScreenshotNotificationRequest(nil)"
}
type Alias MessagesSendScreenshotNotificationRequest
return fmt .Sprintf ("MessagesSendScreenshotNotificationRequest%+v" , Alias (*s ))
}
func (s *MessagesSendScreenshotNotificationRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetReplyTo () (value InputReplyToClass )
GetRandomID () (value int64 )
}) {
s .Peer = from .GetPeer ()
s .ReplyTo = from .GetReplyTo ()
s .RandomID = from .GetRandomID ()
}
func (*MessagesSendScreenshotNotificationRequest ) TypeID () uint32 {
return MessagesSendScreenshotNotificationRequestTypeID
}
func (*MessagesSendScreenshotNotificationRequest ) TypeName () string {
return "messages.sendScreenshotNotification"
}
func (s *MessagesSendScreenshotNotificationRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.sendScreenshotNotification" ,
ID : MessagesSendScreenshotNotificationRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "ReplyTo" ,
SchemaName : "reply_to" ,
},
{
Name : "RandomID" ,
SchemaName : "random_id" ,
},
}
return typ
}
func (s *MessagesSendScreenshotNotificationRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.sendScreenshotNotification#a1405817 as nil" )
}
b .PutID (MessagesSendScreenshotNotificationRequestTypeID )
return s .EncodeBare (b )
}
func (s *MessagesSendScreenshotNotificationRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.sendScreenshotNotification#a1405817 as nil" )
}
if s .Peer == nil {
return fmt .Errorf ("unable to encode messages.sendScreenshotNotification#a1405817: field peer is nil" )
}
if err := s .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.sendScreenshotNotification#a1405817: field peer: %w" , err )
}
if s .ReplyTo == nil {
return fmt .Errorf ("unable to encode messages.sendScreenshotNotification#a1405817: field reply_to is nil" )
}
if err := s .ReplyTo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.sendScreenshotNotification#a1405817: field reply_to: %w" , err )
}
b .PutLong (s .RandomID )
return nil
}
func (s *MessagesSendScreenshotNotificationRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.sendScreenshotNotification#a1405817 to nil" )
}
if err := b .ConsumeID (MessagesSendScreenshotNotificationRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.sendScreenshotNotification#a1405817: %w" , err )
}
return s .DecodeBare (b )
}
func (s *MessagesSendScreenshotNotificationRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.sendScreenshotNotification#a1405817 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.sendScreenshotNotification#a1405817: field peer: %w" , err )
}
s .Peer = value
}
{
value , err := DecodeInputReplyTo (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.sendScreenshotNotification#a1405817: field reply_to: %w" , err )
}
s .ReplyTo = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.sendScreenshotNotification#a1405817: field random_id: %w" , err )
}
s .RandomID = value
}
return nil
}
func (s *MessagesSendScreenshotNotificationRequest ) GetPeer () (value InputPeerClass ) {
if s == nil {
return
}
return s .Peer
}
func (s *MessagesSendScreenshotNotificationRequest ) GetReplyTo () (value InputReplyToClass ) {
if s == nil {
return
}
return s .ReplyTo
}
func (s *MessagesSendScreenshotNotificationRequest ) GetRandomID () (value int64 ) {
if s == nil {
return
}
return s .RandomID
}
func (c *Client ) MessagesSendScreenshotNotification (ctx context .Context , request *MessagesSendScreenshotNotificationRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , 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 .