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

// HelpGetAppConfigRequest represents TL type `help.getAppConfig#61e3f854`.
// Get app-specific configuration, see client configurationĀ¹ for more info on the result.
//
// Links:
//  1. https://core.telegram.org/api/config#client-configuration
//
// See https://core.telegram.org/method/help.getAppConfig for reference.
type HelpGetAppConfigRequest struct {
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// HelpGetAppConfigRequestTypeID is TL type id of HelpGetAppConfigRequest.
const HelpGetAppConfigRequestTypeID = 0x61e3f854

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

func ( *HelpGetAppConfigRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills HelpGetAppConfigRequest from given interface.
func ( *HelpGetAppConfigRequest) ( interface {
	() ( int)
}) {
	.Hash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *HelpGetAppConfigRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getAppConfig",
		ID:   HelpGetAppConfigRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetAppConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getAppConfig#61e3f854 as nil")
	}
	.PutID(HelpGetAppConfigRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetAppConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getAppConfig#61e3f854 as nil")
	}
	.PutInt(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetAppConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getAppConfig#61e3f854 to nil")
	}
	if  := .ConsumeID(HelpGetAppConfigRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getAppConfig#61e3f854: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetAppConfigRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getAppConfig#61e3f854 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode help.getAppConfig#61e3f854: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetHash returns value of Hash field.
func ( *HelpGetAppConfigRequest) () ( int) {
	if  == nil {
		return
	}
	return .Hash
}

// HelpGetAppConfig invokes method help.getAppConfig#61e3f854 returning error if any.
// Get app-specific configuration, see client configurationĀ¹ for more info on the result.
//
// Links:
//  1. https://core.telegram.org/api/config#client-configuration
//
// See https://core.telegram.org/method/help.getAppConfig for reference.
func ( *Client) ( context.Context,  int) (HelpAppConfigClass, error) {
	var  HelpAppConfigBox

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