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

// HelpGetTermsOfServiceUpdateRequest represents TL type `help.getTermsOfServiceUpdate#2ca51fd1`.
// Look for updates of telegram's terms of service
//
// See https://core.telegram.org/method/help.getTermsOfServiceUpdate for reference.
type HelpGetTermsOfServiceUpdateRequest struct {
}

// HelpGetTermsOfServiceUpdateRequestTypeID is TL type id of HelpGetTermsOfServiceUpdateRequest.
const HelpGetTermsOfServiceUpdateRequestTypeID = 0x2ca51fd1

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

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

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *HelpGetTermsOfServiceUpdateRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.getTermsOfServiceUpdate",
		ID:   HelpGetTermsOfServiceUpdateRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpGetTermsOfServiceUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getTermsOfServiceUpdate#2ca51fd1 as nil")
	}
	.PutID(HelpGetTermsOfServiceUpdateRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpGetTermsOfServiceUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.getTermsOfServiceUpdate#2ca51fd1 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *HelpGetTermsOfServiceUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getTermsOfServiceUpdate#2ca51fd1 to nil")
	}
	if  := .ConsumeID(HelpGetTermsOfServiceUpdateRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode help.getTermsOfServiceUpdate#2ca51fd1: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *HelpGetTermsOfServiceUpdateRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.getTermsOfServiceUpdate#2ca51fd1 to nil")
	}
	return nil
}

// HelpGetTermsOfServiceUpdate invokes method help.getTermsOfServiceUpdate#2ca51fd1 returning error if any.
// Look for updates of telegram's terms of service
//
// See https://core.telegram.org/method/help.getTermsOfServiceUpdate for reference.
func ( *Client) ( context.Context) (HelpTermsOfServiceUpdateClass, error) {
	var  HelpTermsOfServiceUpdateBox

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