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

// AccountDeleteBusinessChatLinkRequest represents TL type `account.deleteBusinessChatLink#60073674`.
// Delete a business chat deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#business-chat-links
//
// See https://core.telegram.org/method/account.deleteBusinessChatLink for reference.
type AccountDeleteBusinessChatLinkRequest struct {
	// Slug of the link, obtained as specified here »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#business-chat-links
	Slug string
}

// AccountDeleteBusinessChatLinkRequestTypeID is TL type id of AccountDeleteBusinessChatLinkRequest.
const AccountDeleteBusinessChatLinkRequestTypeID = 0x60073674

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

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

	return true
}

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

// FillFrom fills AccountDeleteBusinessChatLinkRequest from given interface.
func ( *AccountDeleteBusinessChatLinkRequest) ( interface {
	() ( string)
}) {
	.Slug = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountDeleteBusinessChatLinkRequest) () string {
	return "account.deleteBusinessChatLink"
}

// TypeInfo returns info about TL type.
func ( *AccountDeleteBusinessChatLinkRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.deleteBusinessChatLink",
		ID:   AccountDeleteBusinessChatLinkRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Slug",
			SchemaName: "slug",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountDeleteBusinessChatLinkRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.deleteBusinessChatLink#60073674 as nil")
	}
	.PutID(AccountDeleteBusinessChatLinkRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountDeleteBusinessChatLinkRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.deleteBusinessChatLink#60073674 as nil")
	}
	.PutString(.Slug)
	return nil
}

// Decode implements bin.Decoder.
func ( *AccountDeleteBusinessChatLinkRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.deleteBusinessChatLink#60073674 to nil")
	}
	if  := .ConsumeID(AccountDeleteBusinessChatLinkRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode account.deleteBusinessChatLink#60073674: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AccountDeleteBusinessChatLinkRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.deleteBusinessChatLink#60073674 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode account.deleteBusinessChatLink#60073674: field slug: %w", )
		}
		.Slug = 
	}
	return nil
}

// GetSlug returns value of Slug field.
func ( *AccountDeleteBusinessChatLinkRequest) () ( string) {
	if  == nil {
		return
	}
	return .Slug
}

// AccountDeleteBusinessChatLink invokes method account.deleteBusinessChatLink#60073674 returning error if any.
// Delete a business chat deep link »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#business-chat-links
//
// Possible errors:
//
//	400 CHATLINK_SLUG_EMPTY: The specified slug is empty.
//	400 CHATLINK_SLUG_EXPIRED: The specified business chat link has expired.
//
// See https://core.telegram.org/method/account.deleteBusinessChatLink for reference.
func ( *Client) ( context.Context,  string) (bool, error) {
	var  BoolBox

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