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 AiComposeToneExample struct {
From TextWithEntities
To TextWithEntities
}
const AiComposeToneExampleTypeID = 0xf1d628ec
var (
_ bin .Encoder = &AiComposeToneExample {}
_ bin .Decoder = &AiComposeToneExample {}
_ bin .BareEncoder = &AiComposeToneExample {}
_ bin .BareDecoder = &AiComposeToneExample {}
)
func (a *AiComposeToneExample ) Zero () bool {
if a == nil {
return true
}
if !(a .From .Zero ()) {
return false
}
if !(a .To .Zero ()) {
return false
}
return true
}
func (a *AiComposeToneExample ) String () string {
if a == nil {
return "AiComposeToneExample(nil)"
}
type Alias AiComposeToneExample
return fmt .Sprintf ("AiComposeToneExample%+v" , Alias (*a ))
}
func (a *AiComposeToneExample ) FillFrom (from interface {
GetFrom () (value TextWithEntities )
GetTo () (value TextWithEntities )
}) {
a .From = from .GetFrom ()
a .To = from .GetTo ()
}
func (*AiComposeToneExample ) TypeID () uint32 {
return AiComposeToneExampleTypeID
}
func (*AiComposeToneExample ) TypeName () string {
return "aiComposeToneExample"
}
func (a *AiComposeToneExample ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "aiComposeToneExample" ,
ID : AiComposeToneExampleTypeID ,
}
if a == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "From" ,
SchemaName : "from" ,
},
{
Name : "To" ,
SchemaName : "to" ,
},
}
return typ
}
func (a *AiComposeToneExample ) Encode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode aiComposeToneExample#f1d628ec as nil" )
}
b .PutID (AiComposeToneExampleTypeID )
return a .EncodeBare (b )
}
func (a *AiComposeToneExample ) EncodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode aiComposeToneExample#f1d628ec as nil" )
}
if err := a .From .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode aiComposeToneExample#f1d628ec: field from: %w" , err )
}
if err := a .To .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode aiComposeToneExample#f1d628ec: field to: %w" , err )
}
return nil
}
func (a *AiComposeToneExample ) Decode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode aiComposeToneExample#f1d628ec to nil" )
}
if err := b .ConsumeID (AiComposeToneExampleTypeID ); err != nil {
return fmt .Errorf ("unable to decode aiComposeToneExample#f1d628ec: %w" , err )
}
return a .DecodeBare (b )
}
func (a *AiComposeToneExample ) DecodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode aiComposeToneExample#f1d628ec to nil" )
}
{
if err := a .From .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode aiComposeToneExample#f1d628ec: field from: %w" , err )
}
}
{
if err := a .To .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode aiComposeToneExample#f1d628ec: field to: %w" , err )
}
}
return nil
}
func (a *AiComposeToneExample ) GetFrom () (value TextWithEntities ) {
if a == nil {
return
}
return a .From
}
func (a *AiComposeToneExample ) GetTo () (value TextWithEntities ) {
if a == nil {
return
}
return a .To
}
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 .