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

// PhoneEditGroupCallTitleRequest represents TL type `phone.editGroupCallTitle#1ca6ac0a`.
// Edit the title of a group call or livestream
//
// See https://core.telegram.org/method/phone.editGroupCallTitle for reference.
type PhoneEditGroupCallTitleRequest struct {
	// Group call
	Call InputGroupCall
	// New title
	Title string
}

// PhoneEditGroupCallTitleRequestTypeID is TL type id of PhoneEditGroupCallTitleRequest.
const PhoneEditGroupCallTitleRequestTypeID = 0x1ca6ac0a

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

func ( *PhoneEditGroupCallTitleRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Call.Zero()) {
		return false
	}
	if !(.Title == "") {
		return false
	}

	return true
}

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

// FillFrom fills PhoneEditGroupCallTitleRequest from given interface.
func ( *PhoneEditGroupCallTitleRequest) ( interface {
	() ( InputGroupCall)
	() ( string)
}) {
	.Call = .()
	.Title = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PhoneEditGroupCallTitleRequest) () tdp.Type {
	 := tdp.Type{
		Name: "phone.editGroupCallTitle",
		ID:   PhoneEditGroupCallTitleRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Call",
			SchemaName: "call",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PhoneEditGroupCallTitleRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.editGroupCallTitle#1ca6ac0a as nil")
	}
	.PutID(PhoneEditGroupCallTitleRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PhoneEditGroupCallTitleRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.editGroupCallTitle#1ca6ac0a as nil")
	}
	if  := .Call.Encode();  != nil {
		return fmt.Errorf("unable to encode phone.editGroupCallTitle#1ca6ac0a: field call: %w", )
	}
	.PutString(.Title)
	return nil
}

// Decode implements bin.Decoder.
func ( *PhoneEditGroupCallTitleRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.editGroupCallTitle#1ca6ac0a to nil")
	}
	if  := .ConsumeID(PhoneEditGroupCallTitleRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.editGroupCallTitle#1ca6ac0a: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneEditGroupCallTitleRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.editGroupCallTitle#1ca6ac0a to nil")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode phone.editGroupCallTitle#1ca6ac0a: field call: %w", )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode phone.editGroupCallTitle#1ca6ac0a: field title: %w", )
		}
		.Title = 
	}
	return nil
}

// GetCall returns value of Call field.
func ( *PhoneEditGroupCallTitleRequest) () ( InputGroupCall) {
	if  == nil {
		return
	}
	return .Call
}

// GetTitle returns value of Title field.
func ( *PhoneEditGroupCallTitleRequest) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// PhoneEditGroupCallTitle invokes method phone.editGroupCallTitle#1ca6ac0a returning error if any.
// Edit the title of a group call or livestream
//
// Possible errors:
//
//	403 GROUPCALL_FORBIDDEN: The group call has already ended.
//
// See https://core.telegram.org/method/phone.editGroupCallTitle for reference.
func ( *Client) ( context.Context,  *PhoneEditGroupCallTitleRequest) (UpdatesClass, error) {
	var  UpdatesBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Updates, nil
}