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