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

// PhoneLeaveGroupCallPresentationRequest represents TL type `phone.leaveGroupCallPresentation#1c50d144`.
// Stop screen sharing in a group call
//
// See https://core.telegram.org/method/phone.leaveGroupCallPresentation for reference.
type PhoneLeaveGroupCallPresentationRequest struct {
	// The group call
	Call InputGroupCall
}

// PhoneLeaveGroupCallPresentationRequestTypeID is TL type id of PhoneLeaveGroupCallPresentationRequest.
const PhoneLeaveGroupCallPresentationRequestTypeID = 0x1c50d144

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *PhoneLeaveGroupCallPresentationRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode phone.leaveGroupCallPresentation#1c50d144 as nil")
	}
	.PutID(PhoneLeaveGroupCallPresentationRequestTypeID)
	return .EncodeBare()
}

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

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

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

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

// PhoneLeaveGroupCallPresentation invokes method phone.leaveGroupCallPresentation#1c50d144 returning error if any.
// Stop screen sharing in a group call
//
// See https://core.telegram.org/method/phone.leaveGroupCallPresentation for reference.
func ( *Client) ( context.Context,  InputGroupCall) (UpdatesClass, error) {
	var  UpdatesBox

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