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

// PhoneDiscardGroupCallRequest represents TL type `phone.discardGroupCall#7a777135`.
// Terminate a group call
//
// See https://core.telegram.org/method/phone.discardGroupCall for reference.
type PhoneDiscardGroupCallRequest struct {
	// The group call to terminate
	Call InputGroupCall
}

// PhoneDiscardGroupCallRequestTypeID is TL type id of PhoneDiscardGroupCallRequest.
const PhoneDiscardGroupCallRequestTypeID = 0x7a777135

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneDiscardGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.discardGroupCall#7a777135 as nil")
	}
	.PutID(PhoneDiscardGroupCallRequestTypeID)
	return .EncodeBare()
}

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

// Decode implements bin.Decoder.
func ( *PhoneDiscardGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.discardGroupCall#7a777135 to nil")
	}
	if  := .ConsumeID(PhoneDiscardGroupCallRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.discardGroupCall#7a777135: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneDiscardGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.discardGroupCall#7a777135 to nil")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode phone.discardGroupCall#7a777135: field call: %w", )
		}
	}
	return nil
}

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

// PhoneDiscardGroupCall invokes method phone.discardGroupCall#7a777135 returning error if any.
// Terminate a group call
//
// Possible errors:
//
//	400 GROUPCALL_ALREADY_DISCARDED: The group call was already discarded.
//	403 GROUPCALL_FORBIDDEN: The group call has already ended.
//	400 GROUPCALL_INVALID: The specified group call is invalid.
//
// See https://core.telegram.org/method/phone.discardGroupCall for reference.
func ( *Client) ( context.Context,  InputGroupCall) (UpdatesClass, error) {
	var  UpdatesBox

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