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

// BotsRequestedButton represents TL type `bots.requestedButton#f13bbcd7`.
//
// See https://core.telegram.org/constructor/bots.requestedButton for reference.
type BotsRequestedButton struct {
	// WebappReqID field of BotsRequestedButton.
	WebappReqID string
}

// BotsRequestedButtonTypeID is TL type id of BotsRequestedButton.
const BotsRequestedButtonTypeID = 0xf13bbcd7

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *BotsRequestedButton) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.requestedButton#f13bbcd7 as nil")
	}
	.PutID(BotsRequestedButtonTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *BotsRequestedButton) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode bots.requestedButton#f13bbcd7 as nil")
	}
	.PutString(.WebappReqID)
	return nil
}

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

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

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