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

// PhoneJoinGroupCallPresentationRequest represents TL type `phone.joinGroupCallPresentation#cbea6bc4`.
// Start screen sharing in a call
//
// See https://core.telegram.org/method/phone.joinGroupCallPresentation for reference.
type PhoneJoinGroupCallPresentationRequest struct {
	// The group call
	Call InputGroupCall
	// WebRTC parameters
	Params DataJSON
}

// PhoneJoinGroupCallPresentationRequestTypeID is TL type id of PhoneJoinGroupCallPresentationRequest.
const PhoneJoinGroupCallPresentationRequestTypeID = 0xcbea6bc4

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneJoinGroupCallPresentationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.joinGroupCallPresentation#cbea6bc4 as nil")
	}
	.PutID(PhoneJoinGroupCallPresentationRequestTypeID)
	return .EncodeBare()
}

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

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

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

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

// GetParams returns value of Params field.
func ( *PhoneJoinGroupCallPresentationRequest) () ( DataJSON) {
	if  == nil {
		return
	}
	return .Params
}

// PhoneJoinGroupCallPresentation invokes method phone.joinGroupCallPresentation#cbea6bc4 returning error if any.
// Start screen sharing in a call
//
// Possible errors:
//
//	403 PARTICIPANT_JOIN_MISSING: Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall.
//
// See https://core.telegram.org/method/phone.joinGroupCallPresentation for reference.
func ( *Client) ( context.Context,  *PhoneJoinGroupCallPresentationRequest) (UpdatesClass, error) {
	var  UpdatesBox

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