7a04f298d2
- update to latest telegram layer - remove some references to fields in tg.Entities that don't exist in the schema - originally added here: https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e - referenced here - https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3 - https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
143 lines
3.5 KiB
Go
Generated
143 lines
3.5 KiB
Go
Generated
// Code generated by gotdgen, DO NOT EDIT.
|
|
|
|
package e2e
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"sort"
|
|
"strings"
|
|
|
|
"go.uber.org/multierr"
|
|
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
|
|
)
|
|
|
|
// No-op definition for keeping imports.
|
|
var (
|
|
_ = bin.Buffer{}
|
|
_ = context.Background()
|
|
_ = fmt.Stringer(nil)
|
|
_ = strings.Builder{}
|
|
_ = errors.Is
|
|
_ = multierr.AppendInto
|
|
_ = sort.Ints
|
|
_ = tdp.Format
|
|
_ = tgerr.Error{}
|
|
_ = tdjson.Encoder{}
|
|
)
|
|
|
|
// TestDummyFunctionRequest represents TL type `test.dummyFunction#c8357709`.
|
|
//
|
|
// See https://core.telegram.org/method/test.dummyFunction for reference.
|
|
type TestDummyFunctionRequest struct {
|
|
}
|
|
|
|
// TestDummyFunctionRequestTypeID is TL type id of TestDummyFunctionRequest.
|
|
const TestDummyFunctionRequestTypeID = 0xc8357709
|
|
|
|
// Ensuring interfaces in compile-time for TestDummyFunctionRequest.
|
|
var (
|
|
_ bin.Encoder = &TestDummyFunctionRequest{}
|
|
_ bin.Decoder = &TestDummyFunctionRequest{}
|
|
_ bin.BareEncoder = &TestDummyFunctionRequest{}
|
|
_ bin.BareDecoder = &TestDummyFunctionRequest{}
|
|
)
|
|
|
|
func (d *TestDummyFunctionRequest) Zero() bool {
|
|
if d == nil {
|
|
return true
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// String implements fmt.Stringer.
|
|
func (d *TestDummyFunctionRequest) String() string {
|
|
if d == nil {
|
|
return "TestDummyFunctionRequest(nil)"
|
|
}
|
|
type Alias TestDummyFunctionRequest
|
|
return fmt.Sprintf("TestDummyFunctionRequest%+v", Alias(*d))
|
|
}
|
|
|
|
// TypeID returns type id in TL schema.
|
|
//
|
|
// See https://core.telegram.org/mtproto/TL-tl#remarks.
|
|
func (*TestDummyFunctionRequest) TypeID() uint32 {
|
|
return TestDummyFunctionRequestTypeID
|
|
}
|
|
|
|
// TypeName returns name of type in TL schema.
|
|
func (*TestDummyFunctionRequest) TypeName() string {
|
|
return "test.dummyFunction"
|
|
}
|
|
|
|
// TypeInfo returns info about TL type.
|
|
func (d *TestDummyFunctionRequest) TypeInfo() tdp.Type {
|
|
typ := tdp.Type{
|
|
Name: "test.dummyFunction",
|
|
ID: TestDummyFunctionRequestTypeID,
|
|
}
|
|
if d == nil {
|
|
typ.Null = true
|
|
return typ
|
|
}
|
|
typ.Fields = []tdp.Field{}
|
|
return typ
|
|
}
|
|
|
|
// Encode implements bin.Encoder.
|
|
func (d *TestDummyFunctionRequest) Encode(b *bin.Buffer) error {
|
|
if d == nil {
|
|
return fmt.Errorf("can't encode test.dummyFunction#c8357709 as nil")
|
|
}
|
|
b.PutID(TestDummyFunctionRequestTypeID)
|
|
return d.EncodeBare(b)
|
|
}
|
|
|
|
// EncodeBare implements bin.BareEncoder.
|
|
func (d *TestDummyFunctionRequest) EncodeBare(b *bin.Buffer) error {
|
|
if d == nil {
|
|
return fmt.Errorf("can't encode test.dummyFunction#c8357709 as nil")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Decode implements bin.Decoder.
|
|
func (d *TestDummyFunctionRequest) Decode(b *bin.Buffer) error {
|
|
if d == nil {
|
|
return fmt.Errorf("can't decode test.dummyFunction#c8357709 to nil")
|
|
}
|
|
if err := b.ConsumeID(TestDummyFunctionRequestTypeID); err != nil {
|
|
return fmt.Errorf("unable to decode test.dummyFunction#c8357709: %w", err)
|
|
}
|
|
return d.DecodeBare(b)
|
|
}
|
|
|
|
// DecodeBare implements bin.BareDecoder.
|
|
func (d *TestDummyFunctionRequest) DecodeBare(b *bin.Buffer) error {
|
|
if d == nil {
|
|
return fmt.Errorf("can't decode test.dummyFunction#c8357709 to nil")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// TestDummyFunction invokes method test.dummyFunction#c8357709 returning error if any.
|
|
//
|
|
// See https://core.telegram.org/method/test.dummyFunction for reference.
|
|
func (c *Client) TestDummyFunction(ctx context.Context) (bool, error) {
|
|
var result BoolBox
|
|
|
|
request := &TestDummyFunctionRequest{}
|
|
if err := c.rpc.Invoke(ctx, request, &result); err != nil {
|
|
return false, err
|
|
}
|
|
_, ok := result.Bool.(*BoolTrue)
|
|
return ok, nil
|
|
}
|