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