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

// HelpSetBotUpdatesStatusRequest represents TL type `help.setBotUpdatesStatus#ec22cfcd`.
// Informs the server about the number of pending bot updates if they haven't been
// processed for a long time; for bots only
//
// See https://core.telegram.org/method/help.setBotUpdatesStatus for reference.
type HelpSetBotUpdatesStatusRequest struct {
	// Number of pending updates
	PendingUpdatesCount int
	// Error message, if present
	Message string
}

// HelpSetBotUpdatesStatusRequestTypeID is TL type id of HelpSetBotUpdatesStatusRequest.
const HelpSetBotUpdatesStatusRequestTypeID = 0xec22cfcd

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

func ( *HelpSetBotUpdatesStatusRequest) () bool {
	if  == nil {
		return true
	}
	if !(.PendingUpdatesCount == 0) {
		return false
	}
	if !(.Message == "") {
		return false
	}

	return true
}

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

// FillFrom fills HelpSetBotUpdatesStatusRequest from given interface.
func ( *HelpSetBotUpdatesStatusRequest) ( interface {
	() ( int)
	() ( string)
}) {
	.PendingUpdatesCount = .()
	.Message = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *HelpSetBotUpdatesStatusRequest) () tdp.Type {
	 := tdp.Type{
		Name: "help.setBotUpdatesStatus",
		ID:   HelpSetBotUpdatesStatusRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PendingUpdatesCount",
			SchemaName: "pending_updates_count",
		},
		{
			Name:       "Message",
			SchemaName: "message",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *HelpSetBotUpdatesStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.setBotUpdatesStatus#ec22cfcd as nil")
	}
	.PutID(HelpSetBotUpdatesStatusRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpSetBotUpdatesStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.setBotUpdatesStatus#ec22cfcd as nil")
	}
	.PutInt(.PendingUpdatesCount)
	.PutString(.Message)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *HelpSetBotUpdatesStatusRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.setBotUpdatesStatus#ec22cfcd to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode help.setBotUpdatesStatus#ec22cfcd: field pending_updates_count: %w", )
		}
		.PendingUpdatesCount = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode help.setBotUpdatesStatus#ec22cfcd: field message: %w", )
		}
		.Message = 
	}
	return nil
}

// GetPendingUpdatesCount returns value of PendingUpdatesCount field.
func ( *HelpSetBotUpdatesStatusRequest) () ( int) {
	if  == nil {
		return
	}
	return .PendingUpdatesCount
}

// GetMessage returns value of Message field.
func ( *HelpSetBotUpdatesStatusRequest) () ( string) {
	if  == nil {
		return
	}
	return .Message
}

// HelpSetBotUpdatesStatus invokes method help.setBotUpdatesStatus#ec22cfcd returning error if any.
// Informs the server about the number of pending bot updates if they haven't been
// processed for a long time; for bots only
//
// See https://core.telegram.org/method/help.setBotUpdatesStatus for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *HelpSetBotUpdatesStatusRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}