Source File
tl_default_history_ttl_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// No-op definition for keeping imports.var (_ = bin.Buffer{}_ = context.Background()_ = fmt.Stringer(nil)_ = strings.Builder{}_ = errors.Is_ = multierr.AppendInto_ = sort.Ints_ = tdp.Format_ = tgerr.Error{}_ = tdjson.Encoder{})// DefaultHistoryTTL represents TL type `defaultHistoryTTL#43b46b20`.// Contains info about the default value of the Time-To-Live setting, applied to all new// chats.//// See https://core.telegram.org/constructor/defaultHistoryTTL for reference.type DefaultHistoryTTL struct {// Time-To-Live setting applied to all new chats.Period int}// DefaultHistoryTTLTypeID is TL type id of DefaultHistoryTTL.const DefaultHistoryTTLTypeID = 0x43b46b20// Ensuring interfaces in compile-time for DefaultHistoryTTL.var (_ bin.Encoder = &DefaultHistoryTTL{}_ bin.Decoder = &DefaultHistoryTTL{}_ bin.BareEncoder = &DefaultHistoryTTL{}_ bin.BareDecoder = &DefaultHistoryTTL{})func ( *DefaultHistoryTTL) () bool {if == nil {return true}if !(.Period == 0) {return false}return true}// String implements fmt.Stringer.func ( *DefaultHistoryTTL) () string {if == nil {return "DefaultHistoryTTL(nil)"}type DefaultHistoryTTLreturn fmt.Sprintf("DefaultHistoryTTL%+v", (*))}// FillFrom fills DefaultHistoryTTL from given interface.func ( *DefaultHistoryTTL) ( interface {() ( int)}) {.Period = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*DefaultHistoryTTL) () uint32 {return DefaultHistoryTTLTypeID}// TypeName returns name of type in TL schema.func (*DefaultHistoryTTL) () string {return "defaultHistoryTTL"}// TypeInfo returns info about TL type.func ( *DefaultHistoryTTL) () tdp.Type {:= tdp.Type{Name: "defaultHistoryTTL",ID: DefaultHistoryTTLTypeID,}if == nil {.Null = truereturn}.Fields = []tdp.Field{{Name: "Period",SchemaName: "period",},}return}// Encode implements bin.Encoder.func ( *DefaultHistoryTTL) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode defaultHistoryTTL#43b46b20 as nil")}.PutID(DefaultHistoryTTLTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *DefaultHistoryTTL) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode defaultHistoryTTL#43b46b20 as nil")}.PutInt(.Period)return nil}// Decode implements bin.Decoder.func ( *DefaultHistoryTTL) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode defaultHistoryTTL#43b46b20 to nil")}if := .ConsumeID(DefaultHistoryTTLTypeID); != nil {return fmt.Errorf("unable to decode defaultHistoryTTL#43b46b20: %w", )}return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *DefaultHistoryTTL) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode defaultHistoryTTL#43b46b20 to nil")}{, := .Int()if != nil {return fmt.Errorf("unable to decode defaultHistoryTTL#43b46b20: field period: %w", )}.Period =}return nil}// GetPeriod returns value of Period field.func ( *DefaultHistoryTTL) () ( int) {if == nil {return}return .Period}
![]() |
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. |