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

// BotsGetRequestedWebViewButtonRequest represents TL type `bots.getRequestedWebViewButton#bf25b7f3`.
//
// See https://core.telegram.org/method/bots.getRequestedWebViewButton for reference.
type BotsGetRequestedWebViewButtonRequest struct {
	// Bot field of BotsGetRequestedWebViewButtonRequest.
	Bot InputUserClass
	// WebappReqID field of BotsGetRequestedWebViewButtonRequest.
	WebappReqID string
}

// BotsGetRequestedWebViewButtonRequestTypeID is TL type id of BotsGetRequestedWebViewButtonRequest.
const BotsGetRequestedWebViewButtonRequestTypeID = 0xbf25b7f3

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

func ( *BotsGetRequestedWebViewButtonRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Bot == nil) {
		return false
	}
	if !(.WebappReqID == "") {
		return false
	}

	return true
}

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

// FillFrom fills BotsGetRequestedWebViewButtonRequest from given interface.
func ( *BotsGetRequestedWebViewButtonRequest) ( interface {
	() ( InputUserClass)
	() ( string)
}) {
	.Bot = .()
	.WebappReqID = .()
}

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

// TypeName returns name of type in TL schema.
func (*BotsGetRequestedWebViewButtonRequest) () string {
	return "bots.getRequestedWebViewButton"
}

// TypeInfo returns info about TL type.
func ( *BotsGetRequestedWebViewButtonRequest) () tdp.Type {
	 := tdp.Type{
		Name: "bots.getRequestedWebViewButton",
		ID:   BotsGetRequestedWebViewButtonRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Bot",
			SchemaName: "bot",
		},
		{
			Name:       "WebappReqID",
			SchemaName: "webapp_req_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *BotsGetRequestedWebViewButtonRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getRequestedWebViewButton#bf25b7f3 as nil")
	}
	.PutID(BotsGetRequestedWebViewButtonRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotsGetRequestedWebViewButtonRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.getRequestedWebViewButton#bf25b7f3 as nil")
	}
	if .Bot == nil {
		return fmt.Errorf("unable to encode bots.getRequestedWebViewButton#bf25b7f3: field bot is nil")
	}
	if  := .Bot.Encode();  != nil {
		return fmt.Errorf("unable to encode bots.getRequestedWebViewButton#bf25b7f3: field bot: %w", )
	}
	.PutString(.WebappReqID)
	return nil
}

// Decode implements bin.Decoder.
func ( *BotsGetRequestedWebViewButtonRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.getRequestedWebViewButton#bf25b7f3 to nil")
	}
	if  := .ConsumeID(BotsGetRequestedWebViewButtonRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode bots.getRequestedWebViewButton#bf25b7f3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *BotsGetRequestedWebViewButtonRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode bots.getRequestedWebViewButton#bf25b7f3 to nil")
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode bots.getRequestedWebViewButton#bf25b7f3: field bot: %w", )
		}
		.Bot = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode bots.getRequestedWebViewButton#bf25b7f3: field webapp_req_id: %w", )
		}
		.WebappReqID = 
	}
	return nil
}

// GetBot returns value of Bot field.
func ( *BotsGetRequestedWebViewButtonRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .Bot
}

// GetWebappReqID returns value of WebappReqID field.
func ( *BotsGetRequestedWebViewButtonRequest) () ( string) {
	if  == nil {
		return
	}
	return .WebappReqID
}

// BotsGetRequestedWebViewButton invokes method bots.getRequestedWebViewButton#bf25b7f3 returning error if any.
//
// See https://core.telegram.org/method/bots.getRequestedWebViewButton for reference.
func ( *Client) ( context.Context,  *BotsGetRequestedWebViewButtonRequest) (KeyboardButtonClass, error) {
	var  KeyboardButtonBox

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