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

// HelpGetUserInfoRequest represents TL type `help.getUserInfo#38a08d3`.
// Can only be used by TSF members to obtain internal information.
//
// See https://core.telegram.org/method/help.getUserInfo for reference.
type HelpGetUserInfoRequest struct {
	// User ID
	UserID InputUserClass
}

// HelpGetUserInfoRequestTypeID is TL type id of HelpGetUserInfoRequest.
const HelpGetUserInfoRequestTypeID = 0x38a08d3

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

func ( *HelpGetUserInfoRequest) () bool {
	if  == nil {
		return true
	}
	if !(.UserID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills HelpGetUserInfoRequest from given interface.
func ( *HelpGetUserInfoRequest) ( interface {
	() ( InputUserClass)
}) {
	.UserID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *HelpGetUserInfoRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getUserInfo",
		ID:   HelpGetUserInfoRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetUserInfoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getUserInfo#38a08d3 as nil")
	}
	.PutID(HelpGetUserInfoRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetUserInfoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getUserInfo#38a08d3 as nil")
	}
	if .UserID == nil {
		return fmt.Errorf("unable to encode help.getUserInfo#38a08d3: field user_id is nil")
	}
	if  := .UserID.Encode();  != nil {
		return fmt.Errorf("unable to encode help.getUserInfo#38a08d3: field user_id: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetUserInfoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getUserInfo#38a08d3 to nil")
	}
	if  := .ConsumeID(HelpGetUserInfoRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getUserInfo#38a08d3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetUserInfoRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getUserInfo#38a08d3 to nil")
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode help.getUserInfo#38a08d3: field user_id: %w", )
		}
		.UserID = 
	}
	return nil
}

// GetUserID returns value of UserID field.
func ( *HelpGetUserInfoRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .UserID
}

// HelpGetUserInfo invokes method help.getUserInfo#38a08d3 returning error if any.
// Can only be used by TSF members to obtain internal information.
//
// Possible errors:
//
//	403 USER_INVALID: Invalid user provided.
//
// See https://core.telegram.org/method/help.getUserInfo for reference.
func ( *Client) ( context.Context,  InputUserClass) (HelpUserInfoClass, error) {
	var  HelpUserInfoBox

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