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

// PhoneExportedGroupCallInvite represents TL type `phone.exportedGroupCallInvite#204bd158`.
// An invite to a group call or livestream
//
// See https://core.telegram.org/constructor/phone.exportedGroupCallInvite for reference.
type PhoneExportedGroupCallInvite struct {
	// Invite link
	Link string
}

// PhoneExportedGroupCallInviteTypeID is TL type id of PhoneExportedGroupCallInvite.
const PhoneExportedGroupCallInviteTypeID = 0x204bd158

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

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

	return true
}

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

// FillFrom fills PhoneExportedGroupCallInvite from given interface.
func ( *PhoneExportedGroupCallInvite) ( interface {
	() ( string)
}) {
	.Link = .()
}

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

// TypeName returns name of type in TL schema.
func (*PhoneExportedGroupCallInvite) () string {
	return "phone.exportedGroupCallInvite"
}

// TypeInfo returns info about TL type.
func ( *PhoneExportedGroupCallInvite) () tdp.Type {
	 := tdp.Type{
		Name: "phone.exportedGroupCallInvite",
		ID:   PhoneExportedGroupCallInviteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Link",
			SchemaName: "link",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PhoneExportedGroupCallInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.exportedGroupCallInvite#204bd158 as nil")
	}
	.PutID(PhoneExportedGroupCallInviteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PhoneExportedGroupCallInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.exportedGroupCallInvite#204bd158 as nil")
	}
	.PutString(.Link)
	return nil
}

// Decode implements bin.Decoder.
func ( *PhoneExportedGroupCallInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.exportedGroupCallInvite#204bd158 to nil")
	}
	if  := .ConsumeID(PhoneExportedGroupCallInviteTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.exportedGroupCallInvite#204bd158: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneExportedGroupCallInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.exportedGroupCallInvite#204bd158 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode phone.exportedGroupCallInvite#204bd158: field link: %w", )
		}
		.Link = 
	}
	return nil
}

// GetLink returns value of Link field.
func ( *PhoneExportedGroupCallInvite) () ( string) {
	if  == nil {
		return
	}
	return .Link
}