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 MessagesMessageEditData struct {
Flags bin .Fields
Caption bool
}
const MessagesMessageEditDataTypeID = 0x26b5dde6
var (
_ bin .Encoder = &MessagesMessageEditData {}
_ bin .Decoder = &MessagesMessageEditData {}
_ bin .BareEncoder = &MessagesMessageEditData {}
_ bin .BareDecoder = &MessagesMessageEditData {}
)
func (m *MessagesMessageEditData ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Caption == false ) {
return false
}
return true
}
func (m *MessagesMessageEditData ) String () string {
if m == nil {
return "MessagesMessageEditData(nil)"
}
type Alias MessagesMessageEditData
return fmt .Sprintf ("MessagesMessageEditData%+v" , Alias (*m ))
}
func (m *MessagesMessageEditData ) FillFrom (from interface {
GetCaption () (value bool )
}) {
m .Caption = from .GetCaption ()
}
func (*MessagesMessageEditData ) TypeID () uint32 {
return MessagesMessageEditDataTypeID
}
func (*MessagesMessageEditData ) TypeName () string {
return "messages.messageEditData"
}
func (m *MessagesMessageEditData ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.messageEditData" ,
ID : MessagesMessageEditDataTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Caption" ,
SchemaName : "caption" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessagesMessageEditData ) SetFlags () {
if !(m .Caption == false ) {
m .Flags .Set (0 )
}
}
func (m *MessagesMessageEditData ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messages.messageEditData#26b5dde6 as nil" )
}
b .PutID (MessagesMessageEditDataTypeID )
return m .EncodeBare (b )
}
func (m *MessagesMessageEditData ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messages.messageEditData#26b5dde6 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.messageEditData#26b5dde6: field flags: %w" , err )
}
return nil
}
func (m *MessagesMessageEditData ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messages.messageEditData#26b5dde6 to nil" )
}
if err := b .ConsumeID (MessagesMessageEditDataTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.messageEditData#26b5dde6: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessagesMessageEditData ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messages.messageEditData#26b5dde6 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messages.messageEditData#26b5dde6: field flags: %w" , err )
}
}
m .Caption = m .Flags .Has (0 )
return nil
}
func (m *MessagesMessageEditData ) SetCaption (value bool ) {
if value {
m .Flags .Set (0 )
m .Caption = true
} else {
m .Flags .Unset (0 )
m .Caption = false
}
}
func (m *MessagesMessageEditData ) GetCaption () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (0 )
}
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 .