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

// PhoneGetGroupCallStarsRequest represents TL type `phone.getGroupCallStars#6f636302`.
// Fetch the livestream¹ donor and paid-message leaderboard.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#livestreams
//
// See https://core.telegram.org/method/phone.getGroupCallStars for reference.
type PhoneGetGroupCallStarsRequest struct {
	// Call field of PhoneGetGroupCallStarsRequest.
	Call InputGroupCallClass
}

// PhoneGetGroupCallStarsRequestTypeID is TL type id of PhoneGetGroupCallStarsRequest.
const PhoneGetGroupCallStarsRequestTypeID = 0x6f636302

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

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

	return true
}

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

// FillFrom fills PhoneGetGroupCallStarsRequest from given interface.
func ( *PhoneGetGroupCallStarsRequest) ( interface {
	() ( InputGroupCallClass)
}) {
	.Call = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneGetGroupCallStarsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.getGroupCallStars#6f636302 as nil")
	}
	.PutID(PhoneGetGroupCallStarsRequestTypeID)
	return .EncodeBare()
}

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

// Decode implements bin.Decoder.
func ( *PhoneGetGroupCallStarsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.getGroupCallStars#6f636302 to nil")
	}
	if  := .ConsumeID(PhoneGetGroupCallStarsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.getGroupCallStars#6f636302: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneGetGroupCallStarsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.getGroupCallStars#6f636302 to nil")
	}
	{
		,  := DecodeInputGroupCall()
		if  != nil {
			return fmt.Errorf("unable to decode phone.getGroupCallStars#6f636302: field call: %w", )
		}
		.Call = 
	}
	return nil
}

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

// PhoneGetGroupCallStars invokes method phone.getGroupCallStars#6f636302 returning error if any.
// Fetch the livestream¹ donor and paid-message leaderboard.
//
// Links:
//  1. https://core.telegram.org/api/group-calls#livestreams
//
// Possible errors:
//
//	400 GROUPCALL_INVALID: The specified group call is invalid.
//
// See https://core.telegram.org/method/phone.getGroupCallStars for reference.
func ( *Client) ( context.Context,  InputGroupCallClass) (*PhoneGroupCallStars, error) {
	var  PhoneGroupCallStars

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