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 PhoneInviteConferenceCallParticipantRequest struct {
Flags bin .Fields
Video bool
Call InputGroupCallClass
UserID InputUserClass
}
const PhoneInviteConferenceCallParticipantRequestTypeID = 0xbcf22685
var (
_ bin .Encoder = &PhoneInviteConferenceCallParticipantRequest {}
_ bin .Decoder = &PhoneInviteConferenceCallParticipantRequest {}
_ bin .BareEncoder = &PhoneInviteConferenceCallParticipantRequest {}
_ bin .BareDecoder = &PhoneInviteConferenceCallParticipantRequest {}
)
func (i *PhoneInviteConferenceCallParticipantRequest ) Zero () bool {
if i == nil {
return true
}
if !(i .Flags .Zero ()) {
return false
}
if !(i .Video == false ) {
return false
}
if !(i .Call == nil ) {
return false
}
if !(i .UserID == nil ) {
return false
}
return true
}
func (i *PhoneInviteConferenceCallParticipantRequest ) String () string {
if i == nil {
return "PhoneInviteConferenceCallParticipantRequest(nil)"
}
type Alias PhoneInviteConferenceCallParticipantRequest
return fmt .Sprintf ("PhoneInviteConferenceCallParticipantRequest%+v" , Alias (*i ))
}
func (i *PhoneInviteConferenceCallParticipantRequest ) FillFrom (from interface {
GetVideo () (value bool )
GetCall () (value InputGroupCallClass )
GetUserID () (value InputUserClass )
}) {
i .Video = from .GetVideo ()
i .Call = from .GetCall ()
i .UserID = from .GetUserID ()
}
func (*PhoneInviteConferenceCallParticipantRequest ) TypeID () uint32 {
return PhoneInviteConferenceCallParticipantRequestTypeID
}
func (*PhoneInviteConferenceCallParticipantRequest ) TypeName () string {
return "phone.inviteConferenceCallParticipant"
}
func (i *PhoneInviteConferenceCallParticipantRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.inviteConferenceCallParticipant" ,
ID : PhoneInviteConferenceCallParticipantRequestTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Video" ,
SchemaName : "video" ,
Null : !i .Flags .Has (0 ),
},
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (i *PhoneInviteConferenceCallParticipantRequest ) SetFlags () {
if !(i .Video == false ) {
i .Flags .Set (0 )
}
}
func (i *PhoneInviteConferenceCallParticipantRequest ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode phone.inviteConferenceCallParticipant#bcf22685 as nil" )
}
b .PutID (PhoneInviteConferenceCallParticipantRequestTypeID )
return i .EncodeBare (b )
}
func (i *PhoneInviteConferenceCallParticipantRequest ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode phone.inviteConferenceCallParticipant#bcf22685 as nil" )
}
i .SetFlags ()
if err := i .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.inviteConferenceCallParticipant#bcf22685: field flags: %w" , err )
}
if i .Call == nil {
return fmt .Errorf ("unable to encode phone.inviteConferenceCallParticipant#bcf22685: field call is nil" )
}
if err := i .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.inviteConferenceCallParticipant#bcf22685: field call: %w" , err )
}
if i .UserID == nil {
return fmt .Errorf ("unable to encode phone.inviteConferenceCallParticipant#bcf22685: field user_id is nil" )
}
if err := i .UserID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.inviteConferenceCallParticipant#bcf22685: field user_id: %w" , err )
}
return nil
}
func (i *PhoneInviteConferenceCallParticipantRequest ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode phone.inviteConferenceCallParticipant#bcf22685 to nil" )
}
if err := b .ConsumeID (PhoneInviteConferenceCallParticipantRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.inviteConferenceCallParticipant#bcf22685: %w" , err )
}
return i .DecodeBare (b )
}
func (i *PhoneInviteConferenceCallParticipantRequest ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode phone.inviteConferenceCallParticipant#bcf22685 to nil" )
}
{
if err := i .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.inviteConferenceCallParticipant#bcf22685: field flags: %w" , err )
}
}
i .Video = i .Flags .Has (0 )
{
value , err := DecodeInputGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.inviteConferenceCallParticipant#bcf22685: field call: %w" , err )
}
i .Call = value
}
{
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.inviteConferenceCallParticipant#bcf22685: field user_id: %w" , err )
}
i .UserID = value
}
return nil
}
func (i *PhoneInviteConferenceCallParticipantRequest ) SetVideo (value bool ) {
if value {
i .Flags .Set (0 )
i .Video = true
} else {
i .Flags .Unset (0 )
i .Video = false
}
}
func (i *PhoneInviteConferenceCallParticipantRequest ) GetVideo () (value bool ) {
if i == nil {
return
}
return i .Flags .Has (0 )
}
func (i *PhoneInviteConferenceCallParticipantRequest ) GetCall () (value InputGroupCallClass ) {
if i == nil {
return
}
return i .Call
}
func (i *PhoneInviteConferenceCallParticipantRequest ) GetUserID () (value InputUserClass ) {
if i == nil {
return
}
return i .UserID
}
func (c *Client ) PhoneInviteConferenceCallParticipant (ctx context .Context , request *PhoneInviteConferenceCallParticipantRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , nil
}
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 .