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

// HelpGetRecentMeURLsRequest represents TL type `help.getRecentMeUrls#3dc0f114`.
// Get recently used t.me links.
// When installing official applications from "Download Telegram" buttons present in t
// me¹ pages, a referral parameter is passed to applications after installation.
// If, after downloading the application, the user creates a new account (instead of
// logging into an existing one), the referral parameter should be imported using this
// method, which returns the t.me² pages the user recently opened, before installing
// Telegram.
//
// Links:
//  1. https://t.me
//  2. https://t.me
//
// See https://core.telegram.org/method/help.getRecentMeUrls for reference.
type HelpGetRecentMeURLsRequest struct {
	// Referrer
	Referer string
}

// HelpGetRecentMeURLsRequestTypeID is TL type id of HelpGetRecentMeURLsRequest.
const HelpGetRecentMeURLsRequestTypeID = 0x3dc0f114

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

func ( *HelpGetRecentMeURLsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Referer == "") {
		return false
	}

	return true
}

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

// FillFrom fills HelpGetRecentMeURLsRequest from given interface.
func ( *HelpGetRecentMeURLsRequest) ( interface {
	() ( string)
}) {
	.Referer = .()
}

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

// TypeName returns name of type in TL schema.
func (*HelpGetRecentMeURLsRequest) () string {
	return "help.getRecentMeUrls"
}

// TypeInfo returns info about TL type.
func ( *HelpGetRecentMeURLsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getRecentMeUrls",
		ID:   HelpGetRecentMeURLsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Referer",
			SchemaName: "referer",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetRecentMeURLsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getRecentMeUrls#3dc0f114 as nil")
	}
	.PutID(HelpGetRecentMeURLsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetRecentMeURLsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getRecentMeUrls#3dc0f114 as nil")
	}
	.PutString(.Referer)
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetRecentMeURLsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getRecentMeUrls#3dc0f114 to nil")
	}
	if  := .ConsumeID(HelpGetRecentMeURLsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getRecentMeUrls#3dc0f114: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetRecentMeURLsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getRecentMeUrls#3dc0f114 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode help.getRecentMeUrls#3dc0f114: field referer: %w", )
		}
		.Referer = 
	}
	return nil
}

// GetReferer returns value of Referer field.
func ( *HelpGetRecentMeURLsRequest) () ( string) {
	if  == nil {
		return
	}
	return .Referer
}

// HelpGetRecentMeURLs invokes method help.getRecentMeUrls#3dc0f114 returning error if any.
// Get recently used t.me links.
// When installing official applications from "Download Telegram" buttons present in t
// me¹ pages, a referral parameter is passed to applications after installation.
// If, after downloading the application, the user creates a new account (instead of
// logging into an existing one), the referral parameter should be imported using this
// method, which returns the t.me² pages the user recently opened, before installing
// Telegram.
//
// Links:
//  1. https://t.me
//  2. https://t.me
//
// See https://core.telegram.org/method/help.getRecentMeUrls for reference.
func ( *Client) ( context.Context,  string) (*HelpRecentMeURLs, error) {
	var  HelpRecentMeURLs

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