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

// PhoneGetGroupCallStreamChannelsRequest represents TL type `phone.getGroupCallStreamChannels#1ab21940`.
// Get info about RTMP streams in a group call or livestream.
// This method should be invoked to the same group/channel-related DC used for
// downloading livestream chunks¹.
// As usual, the media DC is preferred, if available.
//
// Links:
//  1. https://core.telegram.org/api/files#downloading-files
//
// See https://core.telegram.org/method/phone.getGroupCallStreamChannels for reference.
type PhoneGetGroupCallStreamChannelsRequest struct {
	// Group call or livestream
	Call InputGroupCall
}

// PhoneGetGroupCallStreamChannelsRequestTypeID is TL type id of PhoneGetGroupCallStreamChannelsRequest.
const PhoneGetGroupCallStreamChannelsRequestTypeID = 0x1ab21940

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneGetGroupCallStreamChannelsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.getGroupCallStreamChannels#1ab21940 as nil")
	}
	.PutID(PhoneGetGroupCallStreamChannelsRequestTypeID)
	return .EncodeBare()
}

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

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

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

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

// PhoneGetGroupCallStreamChannels invokes method phone.getGroupCallStreamChannels#1ab21940 returning error if any.
// Get info about RTMP streams in a group call or livestream.
// This method should be invoked to the same group/channel-related DC used for
// downloading livestream chunks¹.
// As usual, the media DC is preferred, if available.
//
// Links:
//  1. https://core.telegram.org/api/files#downloading-files
//
// Possible errors:
//
//	400 GROUPCALL_INVALID: The specified group call is invalid.
//	400 GROUPCALL_JOIN_MISSING: You haven't joined this group call.
//
// See https://core.telegram.org/method/phone.getGroupCallStreamChannels for reference.
func ( *Client) ( context.Context,  InputGroupCall) (*PhoneGroupCallStreamChannels, error) {
	var  PhoneGroupCallStreamChannels

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