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

// HelpInviteText represents TL type `help.inviteText#18cb9f78`.
// Text of a text message with an invitation to install Telegram.
//
// See https://core.telegram.org/constructor/help.inviteText for reference.
type HelpInviteText struct {
	// Text of the message
	Message string
}

// HelpInviteTextTypeID is TL type id of HelpInviteText.
const HelpInviteTextTypeID = 0x18cb9f78

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *HelpInviteText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.inviteText#18cb9f78 as nil")
	}
	.PutID(HelpInviteTextTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *HelpInviteText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode help.inviteText#18cb9f78 as nil")
	}
	.PutString(.Message)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *HelpInviteText) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode help.inviteText#18cb9f78 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode help.inviteText#18cb9f78: field message: %w", )
		}
		.Message = 
	}
	return nil
}

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