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

// InlineBotWebView represents TL type `inlineBotWebView#b57295d5`.
// Specifies an inline mode mini appĀ¹ button, shown on top of the inline query results
// list.
//
// Links:
//  1. https://core.telegram.org/api/bots/webapps#inline-mode-mini-apps
//
// See https://core.telegram.org/constructor/inlineBotWebView for reference.
type InlineBotWebView struct {
	// Text of the button
	Text string
	// Webapp URL
	URL string
}

// InlineBotWebViewTypeID is TL type id of InlineBotWebView.
const InlineBotWebViewTypeID = 0xb57295d5

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

func ( *InlineBotWebView) () bool {
	if  == nil {
		return true
	}
	if !(.Text == "") {
		return false
	}
	if !(.URL == "") {
		return false
	}

	return true
}

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

// FillFrom fills InlineBotWebView from given interface.
func ( *InlineBotWebView) ( interface {
	() ( string)
	() ( string)
}) {
	.Text = .()
	.URL = .()
}

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

// TypeName returns name of type in TL schema.
func (*InlineBotWebView) () string {
	return "inlineBotWebView"
}

// TypeInfo returns info about TL type.
func ( *InlineBotWebView) () tdp.Type {
	 := tdp.Type{
		Name: "inlineBotWebView",
		ID:   InlineBotWebViewTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
		{
			Name:       "URL",
			SchemaName: "url",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InlineBotWebView) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inlineBotWebView#b57295d5 as nil")
	}
	.PutID(InlineBotWebViewTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InlineBotWebView) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inlineBotWebView#b57295d5 as nil")
	}
	.PutString(.Text)
	.PutString(.URL)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InlineBotWebView) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inlineBotWebView#b57295d5 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inlineBotWebView#b57295d5: field text: %w", )
		}
		.Text = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inlineBotWebView#b57295d5: field url: %w", )
		}
		.URL = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *InlineBotWebView) () ( string) {
	if  == nil {
		return
	}
	return .Text
}

// GetURL returns value of URL field.
func ( *InlineBotWebView) () ( string) {
	if  == nil {
		return
	}
	return .URL
}