Source File
tl_help_support_name_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
)
// 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{}
)
// HelpSupportName represents TL type `help.supportName#8c05f1c9`.
// Localized name for telegram support
//
// See https://core.telegram.org/constructor/help.supportName for reference.
type HelpSupportName struct {
// Localized name
Name string
}
// HelpSupportNameTypeID is TL type id of HelpSupportName.
const HelpSupportNameTypeID = 0x8c05f1c9
// Ensuring interfaces in compile-time for HelpSupportName.
var (
_ bin.Encoder = &HelpSupportName{}
_ bin.Decoder = &HelpSupportName{}
_ bin.BareEncoder = &HelpSupportName{}
_ bin.BareDecoder = &HelpSupportName{}
)
func ( *HelpSupportName) () bool {
if == nil {
return true
}
if !(.Name == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func ( *HelpSupportName) () string {
if == nil {
return "HelpSupportName(nil)"
}
type HelpSupportName
return fmt.Sprintf("HelpSupportName%+v", (*))
}
// FillFrom fills HelpSupportName from given interface.
func ( *HelpSupportName) ( interface {
() ( string)
}) {
.Name = .()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*HelpSupportName) () uint32 {
return HelpSupportNameTypeID
}
// TypeName returns name of type in TL schema.
func (*HelpSupportName) () string {
return "help.supportName"
}
// TypeInfo returns info about TL type.
func ( *HelpSupportName) () tdp.Type {
:= tdp.Type{
Name: "help.supportName",
ID: HelpSupportNameTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{
{
Name: "Name",
SchemaName: "name",
},
}
return
}
// Encode implements bin.Encoder.
func ( *HelpSupportName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode help.supportName#8c05f1c9 as nil")
}
.PutID(HelpSupportNameTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *HelpSupportName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode help.supportName#8c05f1c9 as nil")
}
.PutString(.Name)
return nil
}
// Decode implements bin.Decoder.
func ( *HelpSupportName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode help.supportName#8c05f1c9 to nil")
}
if := .ConsumeID(HelpSupportNameTypeID); != nil {
return fmt.Errorf("unable to decode help.supportName#8c05f1c9: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *HelpSupportName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode help.supportName#8c05f1c9 to nil")
}
{
, := .String()
if != nil {
return fmt.Errorf("unable to decode help.supportName#8c05f1c9: field name: %w", )
}
.Name =
}
return nil
}
// GetName returns value of Name field.
func ( *HelpSupportName) () ( string) {
if == nil {
return
}
return .Name
}
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. |