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 PhoneExportGroupCallInviteRequest struct {
Flags bin .Fields
CanSelfUnmute bool
Call InputGroupCall
}
const PhoneExportGroupCallInviteRequestTypeID = 0xe6aa647f
var (
_ bin .Encoder = &PhoneExportGroupCallInviteRequest {}
_ bin .Decoder = &PhoneExportGroupCallInviteRequest {}
_ bin .BareEncoder = &PhoneExportGroupCallInviteRequest {}
_ bin .BareDecoder = &PhoneExportGroupCallInviteRequest {}
)
func (e *PhoneExportGroupCallInviteRequest ) Zero () bool {
if e == nil {
return true
}
if !(e .Flags .Zero ()) {
return false
}
if !(e .CanSelfUnmute == false ) {
return false
}
if !(e .Call .Zero ()) {
return false
}
return true
}
func (e *PhoneExportGroupCallInviteRequest ) String () string {
if e == nil {
return "PhoneExportGroupCallInviteRequest(nil)"
}
type Alias PhoneExportGroupCallInviteRequest
return fmt .Sprintf ("PhoneExportGroupCallInviteRequest%+v" , Alias (*e ))
}
func (e *PhoneExportGroupCallInviteRequest ) FillFrom (from interface {
GetCanSelfUnmute () (value bool )
GetCall () (value InputGroupCall )
}) {
e .CanSelfUnmute = from .GetCanSelfUnmute ()
e .Call = from .GetCall ()
}
func (*PhoneExportGroupCallInviteRequest ) TypeID () uint32 {
return PhoneExportGroupCallInviteRequestTypeID
}
func (*PhoneExportGroupCallInviteRequest ) TypeName () string {
return "phone.exportGroupCallInvite"
}
func (e *PhoneExportGroupCallInviteRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.exportGroupCallInvite" ,
ID : PhoneExportGroupCallInviteRequestTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "CanSelfUnmute" ,
SchemaName : "can_self_unmute" ,
Null : !e .Flags .Has (0 ),
},
{
Name : "Call" ,
SchemaName : "call" ,
},
}
return typ
}
func (e *PhoneExportGroupCallInviteRequest ) SetFlags () {
if !(e .CanSelfUnmute == false ) {
e .Flags .Set (0 )
}
}
func (e *PhoneExportGroupCallInviteRequest ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode phone.exportGroupCallInvite#e6aa647f as nil" )
}
b .PutID (PhoneExportGroupCallInviteRequestTypeID )
return e .EncodeBare (b )
}
func (e *PhoneExportGroupCallInviteRequest ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode phone.exportGroupCallInvite#e6aa647f as nil" )
}
e .SetFlags ()
if err := e .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.exportGroupCallInvite#e6aa647f: field flags: %w" , err )
}
if err := e .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.exportGroupCallInvite#e6aa647f: field call: %w" , err )
}
return nil
}
func (e *PhoneExportGroupCallInviteRequest ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode phone.exportGroupCallInvite#e6aa647f to nil" )
}
if err := b .ConsumeID (PhoneExportGroupCallInviteRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.exportGroupCallInvite#e6aa647f: %w" , err )
}
return e .DecodeBare (b )
}
func (e *PhoneExportGroupCallInviteRequest ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode phone.exportGroupCallInvite#e6aa647f to nil" )
}
{
if err := e .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.exportGroupCallInvite#e6aa647f: field flags: %w" , err )
}
}
e .CanSelfUnmute = e .Flags .Has (0 )
{
if err := e .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.exportGroupCallInvite#e6aa647f: field call: %w" , err )
}
}
return nil
}
func (e *PhoneExportGroupCallInviteRequest ) SetCanSelfUnmute (value bool ) {
if value {
e .Flags .Set (0 )
e .CanSelfUnmute = true
} else {
e .Flags .Unset (0 )
e .CanSelfUnmute = false
}
}
func (e *PhoneExportGroupCallInviteRequest ) GetCanSelfUnmute () (value bool ) {
if e == nil {
return
}
return e .Flags .Has (0 )
}
func (e *PhoneExportGroupCallInviteRequest ) GetCall () (value InputGroupCall ) {
if e == nil {
return
}
return e .Call
}
func (c *Client ) PhoneExportGroupCallInvite (ctx context .Context , request *PhoneExportGroupCallInviteRequest ) (*PhoneExportedGroupCallInvite , error ) {
var result PhoneExportedGroupCallInvite
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , 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 .