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

// HelpGetAppUpdateRequest represents TL type `help.getAppUpdate#522d5a7d`.
// Returns information on update availability for the current application.
//
// See https://core.telegram.org/method/help.getAppUpdate for reference.
type HelpGetAppUpdateRequest struct {
	// Source
	Source string
}

// HelpGetAppUpdateRequestTypeID is TL type id of HelpGetAppUpdateRequest.
const HelpGetAppUpdateRequestTypeID = 0x522d5a7d

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

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

	return true
}

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

// FillFrom fills HelpGetAppUpdateRequest from given interface.
func ( *HelpGetAppUpdateRequest) ( interface {
	() ( string)
}) {
	.Source = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *HelpGetAppUpdateRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getAppUpdate",
		ID:   HelpGetAppUpdateRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Source",
			SchemaName: "source",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetAppUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getAppUpdate#522d5a7d as nil")
	}
	.PutID(HelpGetAppUpdateRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetAppUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getAppUpdate#522d5a7d as nil")
	}
	.PutString(.Source)
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetAppUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getAppUpdate#522d5a7d to nil")
	}
	if  := .ConsumeID(HelpGetAppUpdateRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getAppUpdate#522d5a7d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetAppUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getAppUpdate#522d5a7d to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode help.getAppUpdate#522d5a7d: field source: %w", )
		}
		.Source = 
	}
	return nil
}

// GetSource returns value of Source field.
func ( *HelpGetAppUpdateRequest) () ( string) {
	if  == nil {
		return
	}
	return .Source
}

// HelpGetAppUpdate invokes method help.getAppUpdate#522d5a7d returning error if any.
// Returns information on update availability for the current application.
//
// See https://core.telegram.org/method/help.getAppUpdate for reference.
func ( *Client) ( context.Context,  string) (HelpAppUpdateClass, error) {
	var  HelpAppUpdateBox

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