Source File
tl_stickers_suggested_short_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{}
)
// StickersSuggestedShortName represents TL type `stickers.suggestedShortName#85fea03f`.
// A suggested short name for a stickerpack
//
// See https://core.telegram.org/constructor/stickers.suggestedShortName for reference.
type StickersSuggestedShortName struct {
// Suggested short name
ShortName string
}
// StickersSuggestedShortNameTypeID is TL type id of StickersSuggestedShortName.
const StickersSuggestedShortNameTypeID = 0x85fea03f
// Ensuring interfaces in compile-time for StickersSuggestedShortName.
var (
_ bin.Encoder = &StickersSuggestedShortName{}
_ bin.Decoder = &StickersSuggestedShortName{}
_ bin.BareEncoder = &StickersSuggestedShortName{}
_ bin.BareDecoder = &StickersSuggestedShortName{}
)
func ( *StickersSuggestedShortName) () bool {
if == nil {
return true
}
if !(.ShortName == "") {
return false
}
return true
}
// String implements fmt.Stringer.
func ( *StickersSuggestedShortName) () string {
if == nil {
return "StickersSuggestedShortName(nil)"
}
type StickersSuggestedShortName
return fmt.Sprintf("StickersSuggestedShortName%+v", (*))
}
// FillFrom fills StickersSuggestedShortName from given interface.
func ( *StickersSuggestedShortName) ( interface {
() ( string)
}) {
.ShortName = .()
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*StickersSuggestedShortName) () uint32 {
return StickersSuggestedShortNameTypeID
}
// TypeName returns name of type in TL schema.
func (*StickersSuggestedShortName) () string {
return "stickers.suggestedShortName"
}
// TypeInfo returns info about TL type.
func ( *StickersSuggestedShortName) () tdp.Type {
:= tdp.Type{
Name: "stickers.suggestedShortName",
ID: StickersSuggestedShortNameTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{
{
Name: "ShortName",
SchemaName: "short_name",
},
}
return
}
// Encode implements bin.Encoder.
func ( *StickersSuggestedShortName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode stickers.suggestedShortName#85fea03f as nil")
}
.PutID(StickersSuggestedShortNameTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *StickersSuggestedShortName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode stickers.suggestedShortName#85fea03f as nil")
}
.PutString(.ShortName)
return nil
}
// Decode implements bin.Decoder.
func ( *StickersSuggestedShortName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode stickers.suggestedShortName#85fea03f to nil")
}
if := .ConsumeID(StickersSuggestedShortNameTypeID); != nil {
return fmt.Errorf("unable to decode stickers.suggestedShortName#85fea03f: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *StickersSuggestedShortName) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode stickers.suggestedShortName#85fea03f to nil")
}
{
, := .String()
if != nil {
return fmt.Errorf("unable to decode stickers.suggestedShortName#85fea03f: field short_name: %w", )
}
.ShortName =
}
return nil
}
// GetShortName returns value of ShortName field.
func ( *StickersSuggestedShortName) () ( string) {
if == nil {
return
}
return .ShortName
}
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. |