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

// MessagesDeleteExportedChatInviteRequest represents TL type `messages.deleteExportedChatInvite#d464a42b`.
// Delete a chat invite
//
// See https://core.telegram.org/method/messages.deleteExportedChatInvite for reference.
type MessagesDeleteExportedChatInviteRequest struct {
	// Peer
	Peer InputPeerClass
	// Invite link
	Link string
}

// MessagesDeleteExportedChatInviteRequestTypeID is TL type id of MessagesDeleteExportedChatInviteRequest.
const MessagesDeleteExportedChatInviteRequestTypeID = 0xd464a42b

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

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

	return true
}

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

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

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

// TypeName returns name of type in TL schema.
func (*MessagesDeleteExportedChatInviteRequest) () string {
	return "messages.deleteExportedChatInvite"
}

// TypeInfo returns info about TL type.
func ( *MessagesDeleteExportedChatInviteRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.deleteExportedChatInvite",
		ID:   MessagesDeleteExportedChatInviteRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "Link",
			SchemaName: "link",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesDeleteExportedChatInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.deleteExportedChatInvite#d464a42b as nil")
	}
	.PutID(MessagesDeleteExportedChatInviteRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesDeleteExportedChatInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.deleteExportedChatInvite#d464a42b as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.deleteExportedChatInvite#d464a42b: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.deleteExportedChatInvite#d464a42b: field peer: %w", )
	}
	.PutString(.Link)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesDeleteExportedChatInviteRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.deleteExportedChatInvite#d464a42b to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.deleteExportedChatInvite#d464a42b: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messages.deleteExportedChatInvite#d464a42b: field link: %w", )
		}
		.Link = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *MessagesDeleteExportedChatInviteRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

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

// MessagesDeleteExportedChatInvite invokes method messages.deleteExportedChatInvite#d464a42b returning error if any.
// Delete a chat invite
//
// Possible errors:
//
//	400 INVITE_HASH_EXPIRED: The invite link has expired.
//	400 INVITE_REVOKED_MISSING: The specified invite link was already revoked or is invalid.
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/messages.deleteExportedChatInvite for reference.
func ( *Client) ( context.Context,  *MessagesDeleteExportedChatInviteRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}