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 ChannelsConvertToGigagroupRequest struct {
Channel InputChannelClass
}
const ChannelsConvertToGigagroupRequestTypeID = 0xb290c69
var (
_ bin .Encoder = &ChannelsConvertToGigagroupRequest {}
_ bin .Decoder = &ChannelsConvertToGigagroupRequest {}
_ bin .BareEncoder = &ChannelsConvertToGigagroupRequest {}
_ bin .BareDecoder = &ChannelsConvertToGigagroupRequest {}
)
func (c *ChannelsConvertToGigagroupRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Channel == nil ) {
return false
}
return true
}
func (c *ChannelsConvertToGigagroupRequest ) String () string {
if c == nil {
return "ChannelsConvertToGigagroupRequest(nil)"
}
type Alias ChannelsConvertToGigagroupRequest
return fmt .Sprintf ("ChannelsConvertToGigagroupRequest%+v" , Alias (*c ))
}
func (c *ChannelsConvertToGigagroupRequest ) FillFrom (from interface {
GetChannel () (value InputChannelClass )
}) {
c .Channel = from .GetChannel ()
}
func (*ChannelsConvertToGigagroupRequest ) TypeID () uint32 {
return ChannelsConvertToGigagroupRequestTypeID
}
func (*ChannelsConvertToGigagroupRequest ) TypeName () string {
return "channels.convertToGigagroup"
}
func (c *ChannelsConvertToGigagroupRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "channels.convertToGigagroup" ,
ID : ChannelsConvertToGigagroupRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Channel" ,
SchemaName : "channel" ,
},
}
return typ
}
func (c *ChannelsConvertToGigagroupRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode channels.convertToGigagroup#b290c69 as nil" )
}
b .PutID (ChannelsConvertToGigagroupRequestTypeID )
return c .EncodeBare (b )
}
func (c *ChannelsConvertToGigagroupRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode channels.convertToGigagroup#b290c69 as nil" )
}
if c .Channel == nil {
return fmt .Errorf ("unable to encode channels.convertToGigagroup#b290c69: field channel is nil" )
}
if err := c .Channel .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channels.convertToGigagroup#b290c69: field channel: %w" , err )
}
return nil
}
func (c *ChannelsConvertToGigagroupRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode channels.convertToGigagroup#b290c69 to nil" )
}
if err := b .ConsumeID (ChannelsConvertToGigagroupRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode channels.convertToGigagroup#b290c69: %w" , err )
}
return c .DecodeBare (b )
}
func (c *ChannelsConvertToGigagroupRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode channels.convertToGigagroup#b290c69 to nil" )
}
{
value , err := DecodeInputChannel (b )
if err != nil {
return fmt .Errorf ("unable to decode channels.convertToGigagroup#b290c69: field channel: %w" , err )
}
c .Channel = value
}
return nil
}
func (c *ChannelsConvertToGigagroupRequest ) GetChannel () (value InputChannelClass ) {
if c == nil {
return
}
return c .Channel
}
func (c *ChannelsConvertToGigagroupRequest ) GetChannelAsNotEmpty () (NotEmptyInputChannel , bool ) {
return c .Channel .AsNotEmpty ()
}
func (c *Client ) ChannelsConvertToGigagroup (ctx context .Context , channel InputChannelClass ) (UpdatesClass , error ) {
var result UpdatesBox
request := &ChannelsConvertToGigagroupRequest {
Channel : channel ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , nil
}
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 .