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

// MessagesDeleteRevokedExportedChatInvitesRequest represents TL type `messages.deleteRevokedExportedChatInvites#56987bd5`.
// Delete all revoked chat invites
//
// See https://core.telegram.org/method/messages.deleteRevokedExportedChatInvites for reference.
type MessagesDeleteRevokedExportedChatInvitesRequest struct {
	// Chat
	Peer InputPeerClass
	// ID of the admin that originally generated the revoked chat invites
	AdminID InputUserClass
}

// MessagesDeleteRevokedExportedChatInvitesRequestTypeID is TL type id of MessagesDeleteRevokedExportedChatInvitesRequest.
const MessagesDeleteRevokedExportedChatInvitesRequestTypeID = 0x56987bd5

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

func ( *MessagesDeleteRevokedExportedChatInvitesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.AdminID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesDeleteRevokedExportedChatInvitesRequest from given interface.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) ( interface {
	() ( InputPeerClass)
	() ( InputUserClass)
}) {
	.Peer = .()
	.AdminID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.deleteRevokedExportedChatInvites",
		ID:   MessagesDeleteRevokedExportedChatInvitesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "AdminID",
			SchemaName: "admin_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.deleteRevokedExportedChatInvites#56987bd5 as nil")
	}
	.PutID(MessagesDeleteRevokedExportedChatInvitesRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.deleteRevokedExportedChatInvites#56987bd5 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.deleteRevokedExportedChatInvites#56987bd5: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.deleteRevokedExportedChatInvites#56987bd5: field peer: %w", )
	}
	if .AdminID == nil {
		return fmt.Errorf("unable to encode messages.deleteRevokedExportedChatInvites#56987bd5: field admin_id is nil")
	}
	if  := .AdminID.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.deleteRevokedExportedChatInvites#56987bd5: field admin_id: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.deleteRevokedExportedChatInvites#56987bd5 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.deleteRevokedExportedChatInvites#56987bd5: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode messages.deleteRevokedExportedChatInvites#56987bd5: field admin_id: %w", )
		}
		.AdminID = 
	}
	return nil
}

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

// GetAdminID returns value of AdminID field.
func ( *MessagesDeleteRevokedExportedChatInvitesRequest) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .AdminID
}

// MessagesDeleteRevokedExportedChatInvites invokes method messages.deleteRevokedExportedChatInvites#56987bd5 returning error if any.
// Delete all revoked chat invites
//
// Possible errors:
//
//	400 ADMIN_ID_INVALID: The specified admin ID is invalid.
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//
// See https://core.telegram.org/method/messages.deleteRevokedExportedChatInvites for reference.
func ( *Client) ( context.Context,  *MessagesDeleteRevokedExportedChatInvitesRequest) (bool, error) {
	var  BoolBox

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