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 UsersSuggestBirthdayRequest struct {
ID InputUserClass
Birthday Birthday
}
const UsersSuggestBirthdayRequestTypeID = 0xfc533372
var (
_ bin .Encoder = &UsersSuggestBirthdayRequest {}
_ bin .Decoder = &UsersSuggestBirthdayRequest {}
_ bin .BareEncoder = &UsersSuggestBirthdayRequest {}
_ bin .BareDecoder = &UsersSuggestBirthdayRequest {}
)
func (s *UsersSuggestBirthdayRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .ID == nil ) {
return false
}
if !(s .Birthday .Zero ()) {
return false
}
return true
}
func (s *UsersSuggestBirthdayRequest ) String () string {
if s == nil {
return "UsersSuggestBirthdayRequest(nil)"
}
type Alias UsersSuggestBirthdayRequest
return fmt .Sprintf ("UsersSuggestBirthdayRequest%+v" , Alias (*s ))
}
func (s *UsersSuggestBirthdayRequest ) FillFrom (from interface {
GetID () (value InputUserClass )
GetBirthday () (value Birthday )
}) {
s .ID = from .GetID ()
s .Birthday = from .GetBirthday ()
}
func (*UsersSuggestBirthdayRequest ) TypeID () uint32 {
return UsersSuggestBirthdayRequestTypeID
}
func (*UsersSuggestBirthdayRequest ) TypeName () string {
return "users.suggestBirthday"
}
func (s *UsersSuggestBirthdayRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "users.suggestBirthday" ,
ID : UsersSuggestBirthdayRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Birthday" ,
SchemaName : "birthday" ,
},
}
return typ
}
func (s *UsersSuggestBirthdayRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode users.suggestBirthday#fc533372 as nil" )
}
b .PutID (UsersSuggestBirthdayRequestTypeID )
return s .EncodeBare (b )
}
func (s *UsersSuggestBirthdayRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode users.suggestBirthday#fc533372 as nil" )
}
if s .ID == nil {
return fmt .Errorf ("unable to encode users.suggestBirthday#fc533372: field id is nil" )
}
if err := s .ID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode users.suggestBirthday#fc533372: field id: %w" , err )
}
if err := s .Birthday .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode users.suggestBirthday#fc533372: field birthday: %w" , err )
}
return nil
}
func (s *UsersSuggestBirthdayRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode users.suggestBirthday#fc533372 to nil" )
}
if err := b .ConsumeID (UsersSuggestBirthdayRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode users.suggestBirthday#fc533372: %w" , err )
}
return s .DecodeBare (b )
}
func (s *UsersSuggestBirthdayRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode users.suggestBirthday#fc533372 to nil" )
}
{
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode users.suggestBirthday#fc533372: field id: %w" , err )
}
s .ID = value
}
{
if err := s .Birthday .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode users.suggestBirthday#fc533372: field birthday: %w" , err )
}
}
return nil
}
func (s *UsersSuggestBirthdayRequest ) GetID () (value InputUserClass ) {
if s == nil {
return
}
return s .ID
}
func (s *UsersSuggestBirthdayRequest ) GetBirthday () (value Birthday ) {
if s == nil {
return
}
return s .Birthday
}
func (c *Client ) UsersSuggestBirthday (ctx context .Context , request *UsersSuggestBirthdayRequest ) (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.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .