// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// 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{}
)

// ContactsExportContactTokenRequest represents TL type `contacts.exportContactToken#f8654027`.
// Generates a temporary profile linkĀ¹ for the currently logged-in user.
//
// Links:
//  1. https://core.telegram.org/api/links#temporary-profile-links
//
// See https://core.telegram.org/method/contacts.exportContactToken for reference.
type ContactsExportContactTokenRequest struct {
}

// ContactsExportContactTokenRequestTypeID is TL type id of ContactsExportContactTokenRequest.
const ContactsExportContactTokenRequestTypeID = 0xf8654027

// Ensuring interfaces in compile-time for ContactsExportContactTokenRequest.
var (
	_ bin.Encoder     = &ContactsExportContactTokenRequest{}
	_ bin.Decoder     = &ContactsExportContactTokenRequest{}
	_ bin.BareEncoder = &ContactsExportContactTokenRequest{}
	_ bin.BareDecoder = &ContactsExportContactTokenRequest{}
)

func ( *ContactsExportContactTokenRequest) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *ContactsExportContactTokenRequest) () string {
	if  == nil {
		return "ContactsExportContactTokenRequest(nil)"
	}
	type  ContactsExportContactTokenRequest
	return fmt.Sprintf("ContactsExportContactTokenRequest%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*ContactsExportContactTokenRequest) () uint32 {
	return ContactsExportContactTokenRequestTypeID
}

// TypeName returns name of type in TL schema.
func (*ContactsExportContactTokenRequest) () string {
	return "contacts.exportContactToken"
}

// TypeInfo returns info about TL type.
func ( *ContactsExportContactTokenRequest) () tdp.Type {
	 := tdp.Type{
		Name: "contacts.exportContactToken",
		ID:   ContactsExportContactTokenRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *ContactsExportContactTokenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.exportContactToken#f8654027 as nil")
	}
	.PutID(ContactsExportContactTokenRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ContactsExportContactTokenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode contacts.exportContactToken#f8654027 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *ContactsExportContactTokenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode contacts.exportContactToken#f8654027 to nil")
	}
	if  := .ConsumeID(ContactsExportContactTokenRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode contacts.exportContactToken#f8654027: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *ContactsExportContactTokenRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode contacts.exportContactToken#f8654027 to nil")
	}
	return nil
}

// ContactsExportContactToken invokes method contacts.exportContactToken#f8654027 returning error if any.
// Generates a temporary profile linkĀ¹ for the currently logged-in user.
//
// Links:
//  1. https://core.telegram.org/api/links#temporary-profile-links
//
// See https://core.telegram.org/method/contacts.exportContactToken for reference.
// Can be used by bots.
func ( *Client) ( context.Context) (*ExportedContactToken, error) {
	var  ExportedContactToken

	 := &ContactsExportContactTokenRequest{}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return &, nil
}