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

// SimpleWebViewResultURL represents TL type `simpleWebViewResultUrl#882f76bb`.
// Contains the webview URL with appropriate theme parameters added
//
// See https://core.telegram.org/constructor/simpleWebViewResultUrl for reference.
type SimpleWebViewResultURL struct {
	// URL
	URL string
}

// SimpleWebViewResultURLTypeID is TL type id of SimpleWebViewResultURL.
const SimpleWebViewResultURLTypeID = 0x882f76bb

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *SimpleWebViewResultURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode simpleWebViewResultUrl#882f76bb as nil")
	}
	.PutID(SimpleWebViewResultURLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *SimpleWebViewResultURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode simpleWebViewResultUrl#882f76bb as nil")
	}
	.PutString(.URL)
	return nil
}

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

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

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