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 InputReportReasonSpam struct {
}
const InputReportReasonSpamTypeID = 0x58dbcab8
func (i InputReportReasonSpam ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonSpam {}
_ bin .Decoder = &InputReportReasonSpam {}
_ bin .BareEncoder = &InputReportReasonSpam {}
_ bin .BareDecoder = &InputReportReasonSpam {}
_ ReportReasonClass = &InputReportReasonSpam {}
)
func (i *InputReportReasonSpam ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonSpam ) String () string {
if i == nil {
return "InputReportReasonSpam(nil)"
}
type Alias InputReportReasonSpam
return fmt .Sprintf ("InputReportReasonSpam%+v" , Alias (*i ))
}
func (*InputReportReasonSpam ) TypeID () uint32 {
return InputReportReasonSpamTypeID
}
func (*InputReportReasonSpam ) TypeName () string {
return "inputReportReasonSpam"
}
func (i *InputReportReasonSpam ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonSpam" ,
ID : InputReportReasonSpamTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonSpam ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonSpam#58dbcab8 as nil" )
}
b .PutID (InputReportReasonSpamTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonSpam ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonSpam#58dbcab8 as nil" )
}
return nil
}
func (i *InputReportReasonSpam ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonSpam#58dbcab8 to nil" )
}
if err := b .ConsumeID (InputReportReasonSpamTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonSpam#58dbcab8: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonSpam ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonSpam#58dbcab8 to nil" )
}
return nil
}
type InputReportReasonViolence struct {
}
const InputReportReasonViolenceTypeID = 0x1e22c78d
func (i InputReportReasonViolence ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonViolence {}
_ bin .Decoder = &InputReportReasonViolence {}
_ bin .BareEncoder = &InputReportReasonViolence {}
_ bin .BareDecoder = &InputReportReasonViolence {}
_ ReportReasonClass = &InputReportReasonViolence {}
)
func (i *InputReportReasonViolence ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonViolence ) String () string {
if i == nil {
return "InputReportReasonViolence(nil)"
}
type Alias InputReportReasonViolence
return fmt .Sprintf ("InputReportReasonViolence%+v" , Alias (*i ))
}
func (*InputReportReasonViolence ) TypeID () uint32 {
return InputReportReasonViolenceTypeID
}
func (*InputReportReasonViolence ) TypeName () string {
return "inputReportReasonViolence"
}
func (i *InputReportReasonViolence ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonViolence" ,
ID : InputReportReasonViolenceTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonViolence ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonViolence#1e22c78d as nil" )
}
b .PutID (InputReportReasonViolenceTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonViolence ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonViolence#1e22c78d as nil" )
}
return nil
}
func (i *InputReportReasonViolence ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonViolence#1e22c78d to nil" )
}
if err := b .ConsumeID (InputReportReasonViolenceTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonViolence#1e22c78d: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonViolence ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonViolence#1e22c78d to nil" )
}
return nil
}
type InputReportReasonPornography struct {
}
const InputReportReasonPornographyTypeID = 0x2e59d922
func (i InputReportReasonPornography ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonPornography {}
_ bin .Decoder = &InputReportReasonPornography {}
_ bin .BareEncoder = &InputReportReasonPornography {}
_ bin .BareDecoder = &InputReportReasonPornography {}
_ ReportReasonClass = &InputReportReasonPornography {}
)
func (i *InputReportReasonPornography ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonPornography ) String () string {
if i == nil {
return "InputReportReasonPornography(nil)"
}
type Alias InputReportReasonPornography
return fmt .Sprintf ("InputReportReasonPornography%+v" , Alias (*i ))
}
func (*InputReportReasonPornography ) TypeID () uint32 {
return InputReportReasonPornographyTypeID
}
func (*InputReportReasonPornography ) TypeName () string {
return "inputReportReasonPornography"
}
func (i *InputReportReasonPornography ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonPornography" ,
ID : InputReportReasonPornographyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonPornography ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonPornography#2e59d922 as nil" )
}
b .PutID (InputReportReasonPornographyTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonPornography ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonPornography#2e59d922 as nil" )
}
return nil
}
func (i *InputReportReasonPornography ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonPornography#2e59d922 to nil" )
}
if err := b .ConsumeID (InputReportReasonPornographyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonPornography#2e59d922: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonPornography ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonPornography#2e59d922 to nil" )
}
return nil
}
type InputReportReasonChildAbuse struct {
}
const InputReportReasonChildAbuseTypeID = 0xadf44ee3
func (i InputReportReasonChildAbuse ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonChildAbuse {}
_ bin .Decoder = &InputReportReasonChildAbuse {}
_ bin .BareEncoder = &InputReportReasonChildAbuse {}
_ bin .BareDecoder = &InputReportReasonChildAbuse {}
_ ReportReasonClass = &InputReportReasonChildAbuse {}
)
func (i *InputReportReasonChildAbuse ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonChildAbuse ) String () string {
if i == nil {
return "InputReportReasonChildAbuse(nil)"
}
type Alias InputReportReasonChildAbuse
return fmt .Sprintf ("InputReportReasonChildAbuse%+v" , Alias (*i ))
}
func (*InputReportReasonChildAbuse ) TypeID () uint32 {
return InputReportReasonChildAbuseTypeID
}
func (*InputReportReasonChildAbuse ) TypeName () string {
return "inputReportReasonChildAbuse"
}
func (i *InputReportReasonChildAbuse ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonChildAbuse" ,
ID : InputReportReasonChildAbuseTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonChildAbuse ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonChildAbuse#adf44ee3 as nil" )
}
b .PutID (InputReportReasonChildAbuseTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonChildAbuse ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonChildAbuse#adf44ee3 as nil" )
}
return nil
}
func (i *InputReportReasonChildAbuse ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonChildAbuse#adf44ee3 to nil" )
}
if err := b .ConsumeID (InputReportReasonChildAbuseTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonChildAbuse#adf44ee3: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonChildAbuse ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonChildAbuse#adf44ee3 to nil" )
}
return nil
}
type InputReportReasonOther struct {
}
const InputReportReasonOtherTypeID = 0xc1e4a2b1
func (i InputReportReasonOther ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonOther {}
_ bin .Decoder = &InputReportReasonOther {}
_ bin .BareEncoder = &InputReportReasonOther {}
_ bin .BareDecoder = &InputReportReasonOther {}
_ ReportReasonClass = &InputReportReasonOther {}
)
func (i *InputReportReasonOther ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonOther ) String () string {
if i == nil {
return "InputReportReasonOther(nil)"
}
type Alias InputReportReasonOther
return fmt .Sprintf ("InputReportReasonOther%+v" , Alias (*i ))
}
func (*InputReportReasonOther ) TypeID () uint32 {
return InputReportReasonOtherTypeID
}
func (*InputReportReasonOther ) TypeName () string {
return "inputReportReasonOther"
}
func (i *InputReportReasonOther ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonOther" ,
ID : InputReportReasonOtherTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonOther ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonOther#c1e4a2b1 as nil" )
}
b .PutID (InputReportReasonOtherTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonOther ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonOther#c1e4a2b1 as nil" )
}
return nil
}
func (i *InputReportReasonOther ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonOther#c1e4a2b1 to nil" )
}
if err := b .ConsumeID (InputReportReasonOtherTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonOther#c1e4a2b1: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonOther ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonOther#c1e4a2b1 to nil" )
}
return nil
}
type InputReportReasonCopyright struct {
}
const InputReportReasonCopyrightTypeID = 0x9b89f93a
func (i InputReportReasonCopyright ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonCopyright {}
_ bin .Decoder = &InputReportReasonCopyright {}
_ bin .BareEncoder = &InputReportReasonCopyright {}
_ bin .BareDecoder = &InputReportReasonCopyright {}
_ ReportReasonClass = &InputReportReasonCopyright {}
)
func (i *InputReportReasonCopyright ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonCopyright ) String () string {
if i == nil {
return "InputReportReasonCopyright(nil)"
}
type Alias InputReportReasonCopyright
return fmt .Sprintf ("InputReportReasonCopyright%+v" , Alias (*i ))
}
func (*InputReportReasonCopyright ) TypeID () uint32 {
return InputReportReasonCopyrightTypeID
}
func (*InputReportReasonCopyright ) TypeName () string {
return "inputReportReasonCopyright"
}
func (i *InputReportReasonCopyright ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonCopyright" ,
ID : InputReportReasonCopyrightTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonCopyright ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonCopyright#9b89f93a as nil" )
}
b .PutID (InputReportReasonCopyrightTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonCopyright ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonCopyright#9b89f93a as nil" )
}
return nil
}
func (i *InputReportReasonCopyright ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonCopyright#9b89f93a to nil" )
}
if err := b .ConsumeID (InputReportReasonCopyrightTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonCopyright#9b89f93a: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonCopyright ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonCopyright#9b89f93a to nil" )
}
return nil
}
type InputReportReasonGeoIrrelevant struct {
}
const InputReportReasonGeoIrrelevantTypeID = 0xdbd4feed
func (i InputReportReasonGeoIrrelevant ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonGeoIrrelevant {}
_ bin .Decoder = &InputReportReasonGeoIrrelevant {}
_ bin .BareEncoder = &InputReportReasonGeoIrrelevant {}
_ bin .BareDecoder = &InputReportReasonGeoIrrelevant {}
_ ReportReasonClass = &InputReportReasonGeoIrrelevant {}
)
func (i *InputReportReasonGeoIrrelevant ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonGeoIrrelevant ) String () string {
if i == nil {
return "InputReportReasonGeoIrrelevant(nil)"
}
type Alias InputReportReasonGeoIrrelevant
return fmt .Sprintf ("InputReportReasonGeoIrrelevant%+v" , Alias (*i ))
}
func (*InputReportReasonGeoIrrelevant ) TypeID () uint32 {
return InputReportReasonGeoIrrelevantTypeID
}
func (*InputReportReasonGeoIrrelevant ) TypeName () string {
return "inputReportReasonGeoIrrelevant"
}
func (i *InputReportReasonGeoIrrelevant ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonGeoIrrelevant" ,
ID : InputReportReasonGeoIrrelevantTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonGeoIrrelevant ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonGeoIrrelevant#dbd4feed as nil" )
}
b .PutID (InputReportReasonGeoIrrelevantTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonGeoIrrelevant ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonGeoIrrelevant#dbd4feed as nil" )
}
return nil
}
func (i *InputReportReasonGeoIrrelevant ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonGeoIrrelevant#dbd4feed to nil" )
}
if err := b .ConsumeID (InputReportReasonGeoIrrelevantTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonGeoIrrelevant#dbd4feed: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonGeoIrrelevant ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonGeoIrrelevant#dbd4feed to nil" )
}
return nil
}
type InputReportReasonFake struct {
}
const InputReportReasonFakeTypeID = 0xf5ddd6e7
func (i InputReportReasonFake ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonFake {}
_ bin .Decoder = &InputReportReasonFake {}
_ bin .BareEncoder = &InputReportReasonFake {}
_ bin .BareDecoder = &InputReportReasonFake {}
_ ReportReasonClass = &InputReportReasonFake {}
)
func (i *InputReportReasonFake ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonFake ) String () string {
if i == nil {
return "InputReportReasonFake(nil)"
}
type Alias InputReportReasonFake
return fmt .Sprintf ("InputReportReasonFake%+v" , Alias (*i ))
}
func (*InputReportReasonFake ) TypeID () uint32 {
return InputReportReasonFakeTypeID
}
func (*InputReportReasonFake ) TypeName () string {
return "inputReportReasonFake"
}
func (i *InputReportReasonFake ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonFake" ,
ID : InputReportReasonFakeTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonFake ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonFake#f5ddd6e7 as nil" )
}
b .PutID (InputReportReasonFakeTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonFake ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonFake#f5ddd6e7 as nil" )
}
return nil
}
func (i *InputReportReasonFake ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonFake#f5ddd6e7 to nil" )
}
if err := b .ConsumeID (InputReportReasonFakeTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonFake#f5ddd6e7: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonFake ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonFake#f5ddd6e7 to nil" )
}
return nil
}
type InputReportReasonIllegalDrugs struct {
}
const InputReportReasonIllegalDrugsTypeID = 0xa8eb2be
func (i InputReportReasonIllegalDrugs ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonIllegalDrugs {}
_ bin .Decoder = &InputReportReasonIllegalDrugs {}
_ bin .BareEncoder = &InputReportReasonIllegalDrugs {}
_ bin .BareDecoder = &InputReportReasonIllegalDrugs {}
_ ReportReasonClass = &InputReportReasonIllegalDrugs {}
)
func (i *InputReportReasonIllegalDrugs ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonIllegalDrugs ) String () string {
if i == nil {
return "InputReportReasonIllegalDrugs(nil)"
}
type Alias InputReportReasonIllegalDrugs
return fmt .Sprintf ("InputReportReasonIllegalDrugs%+v" , Alias (*i ))
}
func (*InputReportReasonIllegalDrugs ) TypeID () uint32 {
return InputReportReasonIllegalDrugsTypeID
}
func (*InputReportReasonIllegalDrugs ) TypeName () string {
return "inputReportReasonIllegalDrugs"
}
func (i *InputReportReasonIllegalDrugs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonIllegalDrugs" ,
ID : InputReportReasonIllegalDrugsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonIllegalDrugs ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonIllegalDrugs#a8eb2be as nil" )
}
b .PutID (InputReportReasonIllegalDrugsTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonIllegalDrugs ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonIllegalDrugs#a8eb2be as nil" )
}
return nil
}
func (i *InputReportReasonIllegalDrugs ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonIllegalDrugs#a8eb2be to nil" )
}
if err := b .ConsumeID (InputReportReasonIllegalDrugsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonIllegalDrugs#a8eb2be: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonIllegalDrugs ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonIllegalDrugs#a8eb2be to nil" )
}
return nil
}
type InputReportReasonPersonalDetails struct {
}
const InputReportReasonPersonalDetailsTypeID = 0x9ec7863d
func (i InputReportReasonPersonalDetails ) construct () ReportReasonClass { return &i }
var (
_ bin .Encoder = &InputReportReasonPersonalDetails {}
_ bin .Decoder = &InputReportReasonPersonalDetails {}
_ bin .BareEncoder = &InputReportReasonPersonalDetails {}
_ bin .BareDecoder = &InputReportReasonPersonalDetails {}
_ ReportReasonClass = &InputReportReasonPersonalDetails {}
)
func (i *InputReportReasonPersonalDetails ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputReportReasonPersonalDetails ) String () string {
if i == nil {
return "InputReportReasonPersonalDetails(nil)"
}
type Alias InputReportReasonPersonalDetails
return fmt .Sprintf ("InputReportReasonPersonalDetails%+v" , Alias (*i ))
}
func (*InputReportReasonPersonalDetails ) TypeID () uint32 {
return InputReportReasonPersonalDetailsTypeID
}
func (*InputReportReasonPersonalDetails ) TypeName () string {
return "inputReportReasonPersonalDetails"
}
func (i *InputReportReasonPersonalDetails ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputReportReasonPersonalDetails" ,
ID : InputReportReasonPersonalDetailsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputReportReasonPersonalDetails ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonPersonalDetails#9ec7863d as nil" )
}
b .PutID (InputReportReasonPersonalDetailsTypeID )
return i .EncodeBare (b )
}
func (i *InputReportReasonPersonalDetails ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputReportReasonPersonalDetails#9ec7863d as nil" )
}
return nil
}
func (i *InputReportReasonPersonalDetails ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonPersonalDetails#9ec7863d to nil" )
}
if err := b .ConsumeID (InputReportReasonPersonalDetailsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputReportReasonPersonalDetails#9ec7863d: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputReportReasonPersonalDetails ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputReportReasonPersonalDetails#9ec7863d to nil" )
}
return nil
}
const ReportReasonClassName = "ReportReason"
type ReportReasonClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () ReportReasonClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeReportReason (buf *bin .Buffer ) (ReportReasonClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputReportReasonSpamTypeID :
v := InputReportReasonSpam {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonViolenceTypeID :
v := InputReportReasonViolence {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonPornographyTypeID :
v := InputReportReasonPornography {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonChildAbuseTypeID :
v := InputReportReasonChildAbuse {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonOtherTypeID :
v := InputReportReasonOther {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonCopyrightTypeID :
v := InputReportReasonCopyright {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonGeoIrrelevantTypeID :
v := InputReportReasonGeoIrrelevant {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonFakeTypeID :
v := InputReportReasonFake {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonIllegalDrugsTypeID :
v := InputReportReasonIllegalDrugs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
case InputReportReasonPersonalDetailsTypeID :
v := InputReportReasonPersonalDetails {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode ReportReasonClass: %w" , bin .NewUnexpectedID (id ))
}
}
type ReportReasonBox struct {
ReportReason ReportReasonClass
}
func (b *ReportReasonBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode ReportReasonBox to nil" )
}
v , err := DecodeReportReason (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .ReportReason = v
return nil
}
func (b *ReportReasonBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .ReportReason == nil {
return fmt .Errorf ("unable to encode ReportReasonClass as nil" )
}
return b .ReportReason .Encode (buf )
}
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 .