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

// PhoneGetGroupCallRequest represents TL type `phone.getGroupCall#41845db`.
// Get info about a group call
//
// See https://core.telegram.org/method/phone.getGroupCall for reference.
type PhoneGetGroupCallRequest struct {
	// The group call
	Call InputGroupCall
	// Maximum number of results to return, see pagination¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets
	Limit int
}

// PhoneGetGroupCallRequestTypeID is TL type id of PhoneGetGroupCallRequest.
const PhoneGetGroupCallRequestTypeID = 0x41845db

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneGetGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.getGroupCall#41845db as nil")
	}
	.PutID(PhoneGetGroupCallRequestTypeID)
	return .EncodeBare()
}

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

// Decode implements bin.Decoder.
func ( *PhoneGetGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.getGroupCall#41845db to nil")
	}
	if  := .ConsumeID(PhoneGetGroupCallRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode phone.getGroupCall#41845db: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PhoneGetGroupCallRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode phone.getGroupCall#41845db to nil")
	}
	{
		if  := .Call.Decode();  != nil {
			return fmt.Errorf("unable to decode phone.getGroupCall#41845db: field call: %w", )
		}
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode phone.getGroupCall#41845db: field limit: %w", )
		}
		.Limit = 
	}
	return nil
}

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

// GetLimit returns value of Limit field.
func ( *PhoneGetGroupCallRequest) () ( int) {
	if  == nil {
		return
	}
	return .Limit
}

// PhoneGetGroupCall invokes method phone.getGroupCall#41845db returning error if any.
// Get info about a group call
//
// Possible errors:
//
//	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.getGroupCall for reference.
func ( *Client) ( context.Context,  *PhoneGetGroupCallRequest) (*PhoneGroupCall, error) {
	var  PhoneGroupCall

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