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 AccountSetContactSignUpNotificationRequest struct {
Silent bool
}
const AccountSetContactSignUpNotificationRequestTypeID = 0xcff43f61
var (
_ bin .Encoder = &AccountSetContactSignUpNotificationRequest {}
_ bin .Decoder = &AccountSetContactSignUpNotificationRequest {}
_ bin .BareEncoder = &AccountSetContactSignUpNotificationRequest {}
_ bin .BareDecoder = &AccountSetContactSignUpNotificationRequest {}
)
func (s *AccountSetContactSignUpNotificationRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .Silent == false ) {
return false
}
return true
}
func (s *AccountSetContactSignUpNotificationRequest ) String () string {
if s == nil {
return "AccountSetContactSignUpNotificationRequest(nil)"
}
type Alias AccountSetContactSignUpNotificationRequest
return fmt .Sprintf ("AccountSetContactSignUpNotificationRequest%+v" , Alias (*s ))
}
func (s *AccountSetContactSignUpNotificationRequest ) FillFrom (from interface {
GetSilent () (value bool )
}) {
s .Silent = from .GetSilent ()
}
func (*AccountSetContactSignUpNotificationRequest ) TypeID () uint32 {
return AccountSetContactSignUpNotificationRequestTypeID
}
func (*AccountSetContactSignUpNotificationRequest ) TypeName () string {
return "account.setContactSignUpNotification"
}
func (s *AccountSetContactSignUpNotificationRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.setContactSignUpNotification" ,
ID : AccountSetContactSignUpNotificationRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Silent" ,
SchemaName : "silent" ,
},
}
return typ
}
func (s *AccountSetContactSignUpNotificationRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode account.setContactSignUpNotification#cff43f61 as nil" )
}
b .PutID (AccountSetContactSignUpNotificationRequestTypeID )
return s .EncodeBare (b )
}
func (s *AccountSetContactSignUpNotificationRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode account.setContactSignUpNotification#cff43f61 as nil" )
}
b .PutBool (s .Silent )
return nil
}
func (s *AccountSetContactSignUpNotificationRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode account.setContactSignUpNotification#cff43f61 to nil" )
}
if err := b .ConsumeID (AccountSetContactSignUpNotificationRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.setContactSignUpNotification#cff43f61: %w" , err )
}
return s .DecodeBare (b )
}
func (s *AccountSetContactSignUpNotificationRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode account.setContactSignUpNotification#cff43f61 to nil" )
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode account.setContactSignUpNotification#cff43f61: field silent: %w" , err )
}
s .Silent = value
}
return nil
}
func (s *AccountSetContactSignUpNotificationRequest ) GetSilent () (value bool ) {
if s == nil {
return
}
return s .Silent
}
func (c *Client ) AccountSetContactSignUpNotification (ctx context .Context , silent bool ) (bool , error ) {
var result BoolBox
request := &AccountSetContactSignUpNotificationRequest {
Silent : silent ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , 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 .