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 SMSJobsEligibleToJoin struct {
TermsURL string
MonthlySentSMS int
}
const SMSJobsEligibleToJoinTypeID = 0xdc8b44cf
var (
_ bin .Encoder = &SMSJobsEligibleToJoin {}
_ bin .Decoder = &SMSJobsEligibleToJoin {}
_ bin .BareEncoder = &SMSJobsEligibleToJoin {}
_ bin .BareDecoder = &SMSJobsEligibleToJoin {}
)
func (e *SMSJobsEligibleToJoin ) Zero () bool {
if e == nil {
return true
}
if !(e .TermsURL == "" ) {
return false
}
if !(e .MonthlySentSMS == 0 ) {
return false
}
return true
}
func (e *SMSJobsEligibleToJoin ) String () string {
if e == nil {
return "SMSJobsEligibleToJoin(nil)"
}
type Alias SMSJobsEligibleToJoin
return fmt .Sprintf ("SMSJobsEligibleToJoin%+v" , Alias (*e ))
}
func (e *SMSJobsEligibleToJoin ) FillFrom (from interface {
GetTermsURL () (value string )
GetMonthlySentSMS () (value int )
}) {
e .TermsURL = from .GetTermsURL ()
e .MonthlySentSMS = from .GetMonthlySentSMS ()
}
func (*SMSJobsEligibleToJoin ) TypeID () uint32 {
return SMSJobsEligibleToJoinTypeID
}
func (*SMSJobsEligibleToJoin ) TypeName () string {
return "smsjobs.eligibleToJoin"
}
func (e *SMSJobsEligibleToJoin ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "smsjobs.eligibleToJoin" ,
ID : SMSJobsEligibleToJoinTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "TermsURL" ,
SchemaName : "terms_url" ,
},
{
Name : "MonthlySentSMS" ,
SchemaName : "monthly_sent_sms" ,
},
}
return typ
}
func (e *SMSJobsEligibleToJoin ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode smsjobs.eligibleToJoin#dc8b44cf as nil" )
}
b .PutID (SMSJobsEligibleToJoinTypeID )
return e .EncodeBare (b )
}
func (e *SMSJobsEligibleToJoin ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode smsjobs.eligibleToJoin#dc8b44cf as nil" )
}
b .PutString (e .TermsURL )
b .PutInt (e .MonthlySentSMS )
return nil
}
func (e *SMSJobsEligibleToJoin ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode smsjobs.eligibleToJoin#dc8b44cf to nil" )
}
if err := b .ConsumeID (SMSJobsEligibleToJoinTypeID ); err != nil {
return fmt .Errorf ("unable to decode smsjobs.eligibleToJoin#dc8b44cf: %w" , err )
}
return e .DecodeBare (b )
}
func (e *SMSJobsEligibleToJoin ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode smsjobs.eligibleToJoin#dc8b44cf to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode smsjobs.eligibleToJoin#dc8b44cf: field terms_url: %w" , err )
}
e .TermsURL = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode smsjobs.eligibleToJoin#dc8b44cf: field monthly_sent_sms: %w" , err )
}
e .MonthlySentSMS = value
}
return nil
}
func (e *SMSJobsEligibleToJoin ) GetTermsURL () (value string ) {
if e == nil {
return
}
return e .TermsURL
}
func (e *SMSJobsEligibleToJoin ) GetMonthlySentSMS () (value int ) {
if e == nil {
return
}
return e .MonthlySentSMS
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .