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

// AccountUpdateBusinessIntroRequest represents TL type `account.updateBusinessIntro#a614d034`.
// Set or remove the Telegram Business introduction »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#business-introduction
//
// See https://core.telegram.org/method/account.updateBusinessIntro for reference.
type AccountUpdateBusinessIntroRequest struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Telegram Business introduction, to remove it call the method without setting this flag.
	//
	// Use SetIntro and GetIntro helpers.
	Intro InputBusinessIntro
}

// AccountUpdateBusinessIntroRequestTypeID is TL type id of AccountUpdateBusinessIntroRequest.
const AccountUpdateBusinessIntroRequestTypeID = 0xa614d034

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

func ( *AccountUpdateBusinessIntroRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Intro.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills AccountUpdateBusinessIntroRequest from given interface.
func ( *AccountUpdateBusinessIntroRequest) ( interface {
	() ( InputBusinessIntro,  bool)
}) {
	if ,  := .();  {
		.Intro = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *AccountUpdateBusinessIntroRequest) () tdp.Type {
	 := tdp.Type{
		Name: "account.updateBusinessIntro",
		ID:   AccountUpdateBusinessIntroRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Intro",
			SchemaName: "intro",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *AccountUpdateBusinessIntroRequest) () {
	if !(.Intro.Zero()) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *AccountUpdateBusinessIntroRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.updateBusinessIntro#a614d034 as nil")
	}
	.PutID(AccountUpdateBusinessIntroRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountUpdateBusinessIntroRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.updateBusinessIntro#a614d034 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode account.updateBusinessIntro#a614d034: field flags: %w", )
	}
	if .Flags.Has(0) {
		if  := .Intro.Encode();  != nil {
			return fmt.Errorf("unable to encode account.updateBusinessIntro#a614d034: field intro: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountUpdateBusinessIntroRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.updateBusinessIntro#a614d034 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode account.updateBusinessIntro#a614d034: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		if  := .Intro.Decode();  != nil {
			return fmt.Errorf("unable to decode account.updateBusinessIntro#a614d034: field intro: %w", )
		}
	}
	return nil
}

// SetIntro sets value of Intro conditional field.
func ( *AccountUpdateBusinessIntroRequest) ( InputBusinessIntro) {
	.Flags.Set(0)
	.Intro = 
}

// GetIntro returns value of Intro conditional field and
// boolean which is true if field was set.
func ( *AccountUpdateBusinessIntroRequest) () ( InputBusinessIntro,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Intro, true
}

// AccountUpdateBusinessIntro invokes method account.updateBusinessIntro#a614d034 returning error if any.
// Set or remove the Telegram Business introduction »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#business-introduction
//
// See https://core.telegram.org/method/account.updateBusinessIntro for reference.
func ( *Client) ( context.Context,  *AccountUpdateBusinessIntroRequest) (bool, error) {
	var  BoolBox

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