Source File
tl_contacts_get_saved_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// 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{})// ContactsGetSavedRequest represents TL type `contacts.getSaved#82f1e39f`.// Get all contacts, requires a takeout session, see here » for more info¹.//// Links:// 1. https://core.telegram.org/api/takeout//// See https://core.telegram.org/method/contacts.getSaved for reference.type ContactsGetSavedRequest struct {}// ContactsGetSavedRequestTypeID is TL type id of ContactsGetSavedRequest.const ContactsGetSavedRequestTypeID = 0x82f1e39f// Ensuring interfaces in compile-time for ContactsGetSavedRequest.var (_ bin.Encoder = &ContactsGetSavedRequest{}_ bin.Decoder = &ContactsGetSavedRequest{}_ bin.BareEncoder = &ContactsGetSavedRequest{}_ bin.BareDecoder = &ContactsGetSavedRequest{})func ( *ContactsGetSavedRequest) () bool {if == nil {return true}return true}// String implements fmt.Stringer.func ( *ContactsGetSavedRequest) () string {if == nil {return "ContactsGetSavedRequest(nil)"}type ContactsGetSavedRequestreturn fmt.Sprintf("ContactsGetSavedRequest%+v", (*))}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*ContactsGetSavedRequest) () uint32 {return ContactsGetSavedRequestTypeID}// TypeName returns name of type in TL schema.func (*ContactsGetSavedRequest) () string {return "contacts.getSaved"}// TypeInfo returns info about TL type.func ( *ContactsGetSavedRequest) () tdp.Type {:= tdp.Type{Name: "contacts.getSaved",ID: ContactsGetSavedRequestTypeID,}if == nil {.Null = truereturn}.Fields = []tdp.Field{}return}// Encode implements bin.Encoder.func ( *ContactsGetSavedRequest) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode contacts.getSaved#82f1e39f as nil")}.PutID(ContactsGetSavedRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *ContactsGetSavedRequest) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode contacts.getSaved#82f1e39f as nil")}return nil}// Decode implements bin.Decoder.func ( *ContactsGetSavedRequest) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode contacts.getSaved#82f1e39f to nil")}if := .ConsumeID(ContactsGetSavedRequestTypeID); != nil {return fmt.Errorf("unable to decode contacts.getSaved#82f1e39f: %w", )}return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *ContactsGetSavedRequest) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode contacts.getSaved#82f1e39f to nil")}return nil}// ContactsGetSaved invokes method contacts.getSaved#82f1e39f returning error if any.// Get all contacts, requires a takeout session, see here » for more info¹.//// Links:// 1. https://core.telegram.org/api/takeout//// Possible errors://// 403 TAKEOUT_REQUIRED: A takeout¹ session needs to be initialized first, see here » for more info².//// See https://core.telegram.org/method/contacts.getSaved for reference.func ( *Client) ( context.Context) ([]SavedPhoneContact, error) {var SavedPhoneContactVector:= &ContactsGetSavedRequest{}if := .rpc.Invoke(, , &); != nil {return nil,}return []SavedPhoneContact(.Elems), 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. |